@epikodelabs/streamix / src/public-api / of
Function: of()
of<
T>(value):Atom<T>
Defined in: projects/libraries/streamix/src/lib/factories/of.ts:16
Creates an atom that emits a single value and then completes.
This operator is useful for scenarios where you need to treat a static, single value as an atom. It immediately yields the provided value and then signals completion, which is a common pattern for creating a "hot" atom from a predefined value.
Type Parameters
T
T = any
The type of the value to be emitted.
Parameters
value
MaybePromise<T>
The single value to emit.
Returns
Atom<T>
A new atom that emits the value and then completes.