@epikodelabs/streamix / src/public-api / derived
Function: derived()
Call Signature
derived<
T>(fn,options?):Readable<T>
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:1579
Creates a readonly atom computed from other atoms.
Dependencies are tracked when the callback reads atoms through self.read, self.use, or the callable shorthand self(atom).
derived() is intentionally synchronous. If the computation needs await, cancellation, or restart semantics, model it as a flow() instead.
Type Parameters
T
T
Parameters
fn
(self) => SyncOnly<T>
options?
Returns
Readable<T>
Call Signature
derived<
T>(fn,options?):Readable<T>
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:1585
Creates a readonly atom from a generator-based computation.
The generator may yield atoms or promises before returning the computed value.
Type Parameters
T
T
Parameters
fn
(self) => Generator<Promise<any> | Readable<any>, T, any>
options?
Returns
Readable<T>