Skip to content
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

Strange behavior when merging stream to properties #234

Open
ArseAssassin opened this issue Feb 6, 2017 · 0 comments
Open

Strange behavior when merging stream to properties #234

ArseAssassin opened this issue Feb 6, 2017 · 0 comments

Comments

@ArseAssassin
Copy link

I'm getting strange results when merging an active stream vs. ended stream into properties:

var k = require('kefir')

console.log('Merging property to non-emitting stream')

var s = k.merge([
    k.constant(2).merge(k.later(1000)).toProperty(),
    k.constant(1)
]).toProperty()

s.onValue(console.log) // log: 2
s.offValue(console.log)
s.onValue(console.log) // log: 1
s.offValue(console.log)


console.log('Merging property to ended stream')

var s = k.merge([
    k.constant(2).merge(k.never()).toProperty(),
    k.constant(1)
]).toProperty()

s.onValue(console.log) // log: 1 
s.offValue(console.log)
s.onValue(console.log) // log: 1
s.offValue(console.log)


console.log('Flat merging property to non-emitting stream')

var s = k.merge([
    k.constant(2),
    k.later(1000),
    k.constant(1)
]).toProperty()

s.onValue(console.log) // log: 1
s.offValue(console.log)
s.onValue(console.log) // log: 1
s.offValue(console.log)

I would expect all cases to behave as the last two. Am I missing something here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant