com.raquo.airstream.timing
Type members
Classlikes
This stream emits the last event emitted by parent
, but only after intervalMs
has elapsed
since parent
emitted the previous event.
This stream emits the last event emitted by parent
, but only after intervalMs
has elapsed
since parent
emitted the previous event.
Essentially, this stream emits the parent's last event, but only once the parent stops emitting
events for intervalMs
.
When stopped, this stream "forgets" about any pending events.
See also ThrottleStream
This stream emits a value that the promise resolves with, even if the promise was already resolved.
This stream emits a value that the promise resolves with, even if the promise was already resolved.
This stream emits only once. If you want to remember the value, Use JsPromiseSignal instead.
- Value parameters:
- promise
Note: guarded against failures
- Value parameters:
- next
(currentState => (nextState, nextIntervalMs) Note: guarded against exceptions. If
next
throws, stream will emit that error
Note: This is generally supposed to be used only with streams as inputs. Make sure you know what you're doing if using signals.
Note: This is generally supposed to be used only with streams as inputs. Make sure you know what you're doing if using signals.
- if
parent
is a Signal, this stream mirrorsparent.changes
, notparent
. - if
after
is a Signal, this stream ignores its initial value
ThrottleStream emits at most one event per intervalMs
.
ThrottleStream emits at most one event per intervalMs
.
- All events are emitted in a new transaction, after an async delay, even if the delay is zero ms
- Any incoming event is scheduled to be emitted as soon as possible, but no sooner than
intervalMs
after the last event that was actually emitted by the throttled stream - When an event is scheduled to be emitted, any event that was previously scheduled is cancelled
(that's the nature of throttling, you only get at most one event within
intervalMs
) - Errors are propagated in the same manner
- Stopping the stream cancels scheduled events and makes it forget everything that happened before.
See also See also DebounceStream