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

BufferWhileBy should flush source stream on falsy events from "otherObs" #116

Closed
shamansir opened this issue Jun 26, 2015 · 4 comments
Closed

Comments

@shamansir
Copy link
Contributor

Instead of flushing on the next event from the source stream. So it should rather be like:

var foo = Kefir.sequentially(100, [1, 2, 3, 4, 5, 6, 7, 8]);
var bar = Kefir.sequentially(200, [false, true, false]).delay(40);
var result = foo.bufferWhileBy(bar);
result.log();
> [sequentially.bufferWhileBy] <value> [1, 2]
> [sequentially.bufferWhileBy] <value> [3]
> [sequentially.bufferWhileBy] <value> [4]
> [sequentially.bufferWhileBy] <value> [5, 6]
> [sequentially.bufferWhileBy] <value> [7]
> [sequentially.bufferWhileBy] <value> [8]
> [sequentially.bufferWhileBy] <end>
foo:     ----1----2----3----4----5----6----7----8X
bar:     -----------f---------t---------fX

result:  -----------•--•----•-----------•--•----•X
               [1, 2] [3]  [4]     [5, 6] [7]  [8]
@rpominov
Copy link
Member

I've added an option for this. Will it solve your problem? Also can you try it out before we release (it in master now)?

@shamansir
Copy link
Contributor Author

Here's my implementation where it is flushed this way by default. I'll try your version in few minutes, thank you!

@shamansir
Copy link
Contributor Author

Yes, it works the same way as I expected with even fewer changes, thank you once again! :)

rpominov added a commit that referenced this issue Jun 27, 2015
* master:
  cleanup repository after release
  2.7.0
  update changelog
  add `flushOnChange` option to `a.bufferWhileBy` (rel #116)
  update deps
  update changelog
  update changelog
@rpominov
Copy link
Member

Released in 2.7.0

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

No branches or pull requests

2 participants