Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(use-observable): store subjects into state directly #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Brooooooklyn merged 1 commit into master from update-use-observable
Nov 17, 2018

Conversation

Copy link
Contributor

@zry656565 zry656565 commented Nov 17, 2018

  • simplify the implement of useObservable.

Copy link
Contributor

@Brooooooklyn Brooooooklyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@Brooooooklyn Brooooooklyn merged commit 9ab9091 into master Nov 17, 2018
@Brooooooklyn Brooooooklyn deleted the update-use-observable branch November 17, 2018 14:57
Copy link

@Brooooooklyn this instantiate a Subject every render(first mount & update). It's not performant.
Not sure whether it's better to change code here or open an issue to react for using a callback to return the initial state.

const [state] = setState(() => new BehaviorSubject());

Copy link
Contributor Author

Copy link
Contributor Author

but I guess the cost of initializing a function every render is quite same as initializing a BehaviorSubject. Not very sure about it, need some more tests.

TotooriaHyperion reacted with hooray emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@Brooooooklyn Brooooooklyn Brooooooklyn approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /