Skip to content
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

Add chains of observables #144

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add chains of observables #144

wants to merge 1 commit into from

Conversation

felixb-wix
Copy link
Contributor

No description provided.

@felixb-wix felixb-wix marked this pull request as draft February 14, 2021 09:16
@felixb-wix felixb-wix requested a review from itsh01 February 14, 2021 09:17
@felixb-wix
Copy link
Contributor Author

Concept:

  • both kinds of observables have the same interface ObservableState
  • the chained observable takes multiple observables as an input ("sources"), and subscribes to each. When any of the source observables raises a notification, the chained observables's own subscribers get notified.

What I do in this PR:

  • remove current() from ObservableState
  • add createChainedObservable() to Shell

Open issues:

  • the chained observables don't have any lifecycle mechanism (like React's componentWillUnmount), so currently they have no way to unsubscribe from the sources. A possible solution is use WeakRef for the subscribers.
  • it is possible to accidentally create endless loops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant