-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
[rstream] Subscription without last value #81
Comments
Hey @andrew8er - so you want to not store it in general or just avoid that new subscribers receive the last value? |
For my particular use case, both approaches would solve the issue. Not storing the value would let the GC reclaim the passed value earlier if it is not referenced elsewhere. |
sorry for the delay @andrew8er - I've been thinking about this and no great obvious solution to disable this yet. Been thinking about introducing ctor options objects (e.g. as done for In protected dispatch(x: B) {
this.setValue(x);
...
}
protected setValue(x: B) {
this.last = x;
} Then class AmnesticSubscriber<A, B> extends Subscription<A, B> {
protected setValue(x: B) { }
} |
Ok, that would be slightly better, but I wonder if it really warrants the extra function call. Maybe I just wait for a more generic solution to this problem, I can live with mine right now. |
Yep, that's what I've been wondering too. Since Let's leave this issue open as mental note. Will create a new issue about potential config options soon... |
I have a use case, where I do not want
Subscription<A, B>
to remember the last value. I just want to react to events as they happen. Currently I use this:But I do not think this is very elegant. How would this fit into @thi.ng/rstream?
Maybe related: #74
The text was updated successfully, but these errors were encountered: