Returns the most recent value from the chain/generator, or initialValue (defaulting to undefined) if no value has been emitted yet.
initialValue
const ticker = asValue(tick({ interval: 1000 }));x = ticker(); // Get the most recent value Copy
const ticker = asValue(tick({ interval: 1000 }));x = ticker(); // Get the most recent value
Every time it's called, it fetches a new value from the generator, assuming it isn't already awaiting a result.
In the meantime, the last value (or initialValue) is returned.
Value to wrap
Optional
Initial value
Returns the most recent value from the chain/generator, or
initialValue
(defaulting to undefined) if no value has been emitted yet.Every time it's called, it fetches a new value from the generator, assuming it isn't already awaiting a result.
In the meantime, the last value (or
initialValue
) is returned.