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

Bacon.when loses last event if pattern has a Property without initial value #720

Open
milankinen opened this issue Jul 11, 2018 · 0 comments

Comments

@milankinen
Copy link
Contributor

This one is working as expected:

const s = Bacon.sequentially(5, [1, 2, 3, 4])
const p = Bacon.sequentially(10, ["lol", "bal"]).toProperty("")
Bacon.when(
  [s, p], (...args) => args
).log("when")
// Outputs:
// when [ 1, '' ]
// when [ 2, 'lol' ]
// when [ 3, 'lol' ]
// when [ 4, 'bal' ]
// when <end>

However, this is not (note that .toProperty() is called without initial value). The number of s events does not matter, the last value is always missing.

const s = Bacon.sequentially(5, [1, 2, 3, 4])
const p = Bacon.sequentially(10, ["lol", "bal"]).toProperty()
Bacon.when(
  [s, p], (...args) => args
).log("when")
// Outputs:
// when [ 1, 'lol' ]
// when [ 2, 'lol' ]
// when [ 3, 'bal' ]
// when <end>

Bacon version is [email protected]

@milankinen milankinen changed the title .when loses the last event if pattern has a Property without initial value Bacon.when loses last event if pattern has a Property without initial value Jul 11, 2018
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