bordoley / reactive-js

Fast modern reactive Javascript programming library
MIT License
11 stars 0 forks source link

Queueable needs a way to notify when it can accept more notifications #493

Closed bordoley closed 1 year ago

bordoley commented 1 year ago

Queueable requests a source pause when at capacity by signaling via the enqueue return Boolean, but provides no way for a source to be notified when it can start sending data again.

the default observable.enqueue method simply requests a scheduler yield which works for some use cases such as a hot producer, but doesn’t work for the pauseable observable use case

bordoley commented 1 year ago

fixed by changing dispatcher to implement EventEmitter. We can extend this later by providing a way to turn a pauseableObservable into an DispatcherEventListener.