Creates a readable reactive based on a (async)generator or iterator
// Generator a random value every 5 seconds constvaluesOverTime = Flow.interval(() =>Math.random(), 5000); // Wrap the generator constr = Rx.From.iterator(time); // Get notified when there is a new value r.onValue(v=> { console.log(v); });
Awaiting values could potentially hang code. Thus there is a readTimeout, the maximum time to wait for a value from the generator. Default: 5 minutes.
If signal is given, this will also cancel waiting for the value.
Creates a readable reactive based on a (async)generator or iterator
Awaiting values could potentially hang code. Thus there is a
readTimeout
, the maximum time to wait for a value from the generator. Default: 5 minutes. Ifsignal
is given, this will also cancel waiting for the value.