after is a more readable version of setTimeout, implemented as an await-able Observable.
after is lazy, and cancelable like an Observable, and then-able and await-able like a Promise.
after is single-valued if a primitive or thunk is its 2nd argument, multivalued if an Observable.
For a delay of 0, the value is given synchronously when .subscribe() is called.
Returns
An await-able Observable of the object, thunk return value, or Observable's notification(s).
Argument
delayArg Either a number of milliseconds, a Promise, setTimeout, or requestAnimationFrame
Argument
valueProvider Can be a value, a function returning a value, or an Observable.
Argument
observer A TapObserver that can handle subscription or value events.
after
is a more readable version ofsetTimeout
, implemented as anawait
-able Observable.after
is lazy, and cancelable like an Observable, andthen
-able andawait
-able like a Promise.after
is single-valued if a primitive or thunk is its 2nd argument, multivalued if an Observable. For a delay of 0, the value is given synchronously when.subscribe()
is called.Returns
An
await
-able Observable of the object, thunk return value, or Observable's notification(s).Argument
delayArg
Either a number of milliseconds, a Promise,setTimeout
, orrequestAnimationFrame
Argument
valueProvider
Can be a value, a function returning a value, or an Observable.Argument
observer
ATapObserver
that can handle subscription or value events.See
https://www.youtube.com/watch?v=Bvsb9Qy1V9g for how
after
can be thought of as a 2-dimensional value, a composable vector in the 2-D space of time and values.Example