Add `set` alias for `next` on `BehaviorSubject`
See original GitHub issuePer this discussion on Twitter
Basically, svelte has amazing support for RxJS. Particularly in reading from RxJS observables.
This very small addition to RxJS would enable Svelte users to very conveniently trigger reactive updates through RxJS.
Proposal
Just alias next as set on BehaviorSubject. (I don’t see a reason yet to add it to all subjects).
That would enable Svelte users to simply bind to them in their templates.
cc/ @Rich-Harris
Other things
It’s probably worth discussion with Svelte experts if this solves a big enough use case for them to be a valid change, and/or what other use cases we might need to consider.
Issue Analytics
- State:
 - Created 4 years ago
 - Reactions:8
 - Comments:12 (5 by maintainers)
 
Top Results From Across the Web
How can I subscribe to a BehaviorSubject from another ...
From your psuedo-code it looks like you are already subscribing to the BehaviorSubject from Service A in Service B. If you want to...
Read more >BehaviorSubject - RxJS Reference - InDepth.Dev
BehaviorSubject is a variant of a Subject which has a notion of the current value that it stores and emits to all new...
Read more >slingjs - npm
Sling is a client-side JavaScript framework for building Single Page Applications (SPAs). Sling is lightweight, 23KB minified, and less than 7KB gzipped. Sling ......
Read more >Overview - ReactiveX
There are also a few specializations of the Subject type: BehaviorSubject , ReplaySubject , and AsyncSubject . Multicasted Observables. A "multicasted ...
Read more >Handling Observables with NgIf and the Async Pipe
Get 73% off the Angular Master Bundle! See the bundle then add to cart and your discount is applied. 1 days. 07 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So after discussion with the core team. It seems more reasonable to create a separate package with a
SvelteSubjectthat would behave in the way you want… it is exactly this:@Rich-Harris what do you think about us adding this to the svelte org? (I’d happily help maintain that for you)
Started a small project with the “SvelteSubject” and implemented the svelte stores as RxJS Observables: https://github.com/spierala/svelte-store-rxjs
writable()returns aWritableinstance.Writableextends RxJS BehaviorSubject.readable()andderived()return a RxJS Observable