Skip to content

Conversation

Conduitry
Copy link
Member

Fixes #3304.

This also refactors stuff a little bit. The subscribe helper is now called component_subscribe (for lack of a better name), and there's a new subscribe helper that just does subscription and returns the unsubscription function, whether this is a Svelte store or an RxJS observable. This new helper is now used in component_subscribe, get_store_value, and in the store reassignment/resubscription handling code.

@Conduitry
Copy link
Member Author

I think with this PR the only place left where we're blindly calling .subscribe() and assuming it'll directly return an unsubscription function is in derived. But that's so tied to our other store implementations now that I'm guessing it doesn't make sense to try to make it work with Observables.

@Rich-Harris Rich-Harris merged commit 6cbdd9b into sveltejs:master Aug 3, 2019
@Rich-Harris
Copy link
Member

agree with that assessment, RxJS people have a gazillion ways to do the same thing

@Conduitry Conduitry deleted the gh-3304 branch August 3, 2019 16:19
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.

Observable-as-store error on reassignment
2 participants