Emits a value if source does not emit a value after interval
has elapsed. This can be useful to reset a reactive to some
'zero' state if nothing is going on.
If source emits faster than the interval, it won't get triggered.
Default for 'timeout': 1000s.
// Emit 'hello' if 'source' doesn't emit a value after 1 minute constr = Rx.timeoutValue(source, { value:'hello', interval: { mins:1 } });
Can also emit results from a function or generator
// Emits a random number if 'source' doesn't emit a value after 500ms constr = Rx.timeoutValue(source, { fn:Math.random, interval:500 });
If immediate option is true (default), the timer starts from stream initialisation.
Otherwise it won't start until it observes the first value from source.
Emits a value if
source
does not emit a value afterinterval
has elapsed. This can be useful to reset a reactive to some 'zero' state if nothing is going on.If
source
emits faster than theinterval
, it won't get triggered.Default for 'timeout': 1000s.
Can also emit results from a function or generator
If
immediate
option is true (default), the timer starts from stream initialisation. Otherwise it won't start until it observes the first value fromsource
.