cujojs / most

Ultra-high performance reactive programming
MIT License
3.49k stars 231 forks source link

fix(slice): Reinstate immediate synchronous dispose #467

Closed briancavalier closed 7 years ago

briancavalier commented 7 years ago

Summary

Reinstate immediate synchronous dispose in take and takeWhile rather than relying solely on end() to dispose the whole Sink chain. Use SettableDisposable to deal with cases where source stream may end synchronously before source.run returns (and thus SliceSink's this.disposable is not yet assigned)

Fix #466

briancavalier commented 7 years ago

After some discussion with the most.js team, we like the alternative in the fix-466-2 branch better. Closing this, and will open a new PR on that branch.