cujojs / most

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

fix(slice): Use SettableDisposable and synchronous immediate dispose #468

Closed briancavalier closed 6 years ago

briancavalier commented 6 years ago

Summary

Fix #466

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)