-
Notifications
You must be signed in to change notification settings - Fork 97
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
Should .take() unsubscribe from the source when it's done? #35
Comments
It appears to be the fault of the synchronous 'emit' -- if I make that asynchronous by wrapping it in process.nextTick(), it behaves as expected. |
Yes, there is a bug. Not easy to fix on the first look though. Funny that I found similar bug in Bacon recently baconjs/bacon.js#523 The bug occurs when you truing to unsubscribe from a stream in response to the first value from it, and that first value is emitted synchronously. Will think of how to fix this. |
* master: rm /dist 0.5.2 update changelog fix bug in .fromBinder when it not calls unsub with .take(1) and sync emit (fix #35)
The fix was actually pretty easy. Fixed in v0.5.2. |
Cool, thanks! Back to trying to get pagination to work |
Test code:
The unsubscribe callback is never called
According to this issue, the subscriber to 'thing' should detach automatically after 1 item, so maybe this is a bug with fromBinder?
Interestingly, if I change it to take(2), the callback is called
The text was updated successfully, but these errors were encountered: