We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following snippet (directly copy-pastable in requirebin) :
const flyd = require('flyd') const switchLatest = require('flyd/module/switchlatest') const stream = flyd.stream(3) const mapped = switchLatest( flyd.map(function(x) { return flyd.stream(x * 2) }, stream) ) flyd.on(function(value) { console.log('stream ended', value); }, stream.end) flyd.on(function(value) { console.log('mapped ended', value); }, mapped.end) flyd.on(function(value) { console.log('stream value', value); }, stream) flyd.on(function(value) { console.log('mapped value', value); }, mapped) stream(4) stream(5)
It produces the following console ouput:
stream value 3 stream value 4 mapped value 8 mapped value 8 stream value 5 mapped value 10 mapped value 10
Why is the mapped stream called twice for every change to the source stream?
The text was updated successfully, but these errors were encountered:
It's most probably a bug with requirebin it self.
requirebin
I couldn't reproduce it anywhere else, including locally ([email protected] with all flyd @ 1.x and above), on runkit and jsfiddle browserified.
Sorry, something went wrong.
No branches or pull requests
Consider the following snippet (directly copy-pastable in requirebin) :
It produces the following console ouput:
Why is the mapped stream called twice for every change to the source stream?
The text was updated successfully, but these errors were encountered: