@epikodelabs/streamix / src/public-api / Writable
Interface: Writable<T>
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:140
Writable atom returned by atom.
Extends
Atom<T>
Type Parameters
T
T = any
Properties
type
readonlytype:"atom"
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:58
Runtime discriminator for atom-like values.
Inherited from
name?
readonlyoptionalname?:string
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:60
Optional human-readable name used by integrations and diagnostics.
Inherited from
value
readonlyvalue:T
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:62
Current value. Throws if the atom is currently in an error state.
Inherited from
safeValue
readonlysafeValue:T
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:64
Current value, returning the last safe value when the atom has errored.
Inherited from
previous
readonlyprevious:T
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:66
Previously emitted value.
Inherited from
disposed
readonlydisposed:boolean
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:68
True after the atom has been disposed.
Inherited from
dirty
readonlydirty:boolean
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:70
True when reactive work is queued but not flushed yet.
Inherited from
error?
readonlyoptionalerror?:any
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:72
Last error captured by this atom, if any.
Inherited from
subscriberCount?
readonlyoptionalsubscriberCount?:number
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:74
Number of active subscribers, when exposed by the implementation.
Inherited from
Methods
subscribe()
subscribe(
callback?):Subscription
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:84
Subscribes to this atom's current state and future value changes.
If the atom already has a current value, the callback is invoked synchronously once with (current, previous) during subscription. Atoms that have not produced a value yet wait for their first emission. The returned subscription must be disposed when the listener is no longer needed.
Parameters
callback?
(current, previous) => any
Returns
Inherited from
onError()
onError(
handler):Subscription
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:86
Subscribes to atom errors.
Parameters
handler
(error) => void
Returns
Inherited from
dispose()
dispose():
void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:88
Stops the atom and releases all subscribers/resources.
Returns
void
Inherited from
[asyncIterator]()
[asyncIterator]():
AsyncIterator<T>
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:90
Iterates emitted values until the atom is disposed or iteration is closed.
Returns
AsyncIterator<T>
Inherited from
next()
next(
value):void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:142
Emits a new value.
Parameters
value
T
Returns
void
set()
set(
value):void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:144
Alias for next.
Parameters
value
T
Returns
void
fail()
fail(
err,options?):void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:146
Puts the atom into an error state and notifies error handlers.
Parameters
err
any
options?
terminate?
boolean
Returns
void
recover()?
optionalrecover():void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:148
Clears a recoverable error state, when supported.
Returns
void
clearError()?
optionalclearError():void
Defined in: projects/libraries/streamix/src/lib/atoms/atom.ts:150
Clears the stored error without emitting a value, when supported.
Returns
void