-
Notifications
You must be signed in to change notification settings - Fork 13
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
implement RxJS-like BehaviorSubject #3
Comments
Any suggestions on better naming? |
If I were naming this I'd first try to describe its behaviour.
How to say this in a class name? Ideas:
|
I'm actually beginning to wonder if it would be a better to simply provide a single function with options instead. No real reason to continue to emulate RxJS. const {sink, stream} = subject() // regular subject
const {sink, stream} = subject({replay: true}) // replaySubject
const {sink, stream} = subject({replay: true, initialValue: 1}) // behaviorSubject |
I would vote for something like const {sink, stream} cacheLatest(size: number)
sink.add(initial) supporting an initial value in the constructor seems superfluous at best, especially for buffers > 1. |
I actually went ahead with a similar API to the above. If you check the README now, it has the API I decided upon. It does include the initial values. |
Overview
Create a subject which behaves similarly to RxJS' BehaviorSubject
Motivation
Easier transitioning from RxJS to Most
The text was updated successfully, but these errors were encountered: