LxBase<T> class abstract

The primary implementation base for reactive objects.

LxBase provides the core mechanics for value storage, stream propagation, and middleware integration.

Inheritance
Implemented types
Available extensions

Constructors

LxBase(T initial, {void onListen()?, void onCancel()?, String? name, bool isSensitive = false, bool equals(T previous, T current)?})
Creates a reactive wrapper around initial.

Properties

computedValue → T

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Alias for requireValue.
no setter
equals bool Function(T previous, T current)?
Custom equality function. When null, uses ==.
final
errorOrNull Object?

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns the current error if the status is LxError, otherwise null.
no setter
graphDepth int
Returns the current depth in the dependency graph.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hasListener bool
Whether there are active listeners.
no setteroverride
hasValue bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Alias for isSuccess.
no setter
id int
A unique runtime identifier for this reactive instance.
final
isDisposed bool
Whether the reactive object has been closed/disposed.
no setteroverride
isError bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns true if the status is LxError.
no setter
isIdle bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns true if the status is LxIdle.
no setter
isLoading bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Alias for isWaiting.
no setter
isSensitive bool
Whether this reactive object contains sensitive data.
getter/setter pairoverride
isSuccess bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns true if the status is LxSuccess.
no setter
isWaiting bool

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns true if the status is LxWaiting.
no setter
lastValue → T?

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns the LxStatus.lastValue (the most recent successful value).
no setter
name String?
An optional descriptive name for debugging and profiling.
getter/setter pairoverride
onCancel → void Function()?
Called when the stream is cancelled.
final
onListen → void Function()?
Called when the stream is listened to.
final
ownerId String?
The registration key of the owning controller, if applicable.
getter/setter pairoverride
requireValue → T

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Force-retrieves the current value if the status is LxSuccess.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTraceOrNull StackTrace?

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns the stack trace if the status is LxError, otherwise null.
no setter
stream Stream<T>
A Stream that emits the latest value whenever it updates.
no setteroverride
value → T
The current state of the reactive object.
no setteroverride
valueOrNull → T?

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns the current value if the status is LxSuccess, otherwise null.
no setter
wait Future<T>

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Returns a Future that completes when the operation reaches a terminal state.
no setter

Methods

addListener(void listener()) → void
Adds a listener.
override
call() → T
Functor-like call to get value.
close() → void
Permanently closes the reactive object and releases all internal resources.
override
dispose() → void
Disposes the notifier.
inherited
listen(void callback(T value)) LxWorker<T>

Available on LxReactive<T>, provided by the LxReactiveWatchExtensions extension

Attaches a listener to this reactive value.
listen(void onSuccess(T value), {void onIdle()?, void onWaiting()?, void onError(Object error)?, dynamic onProcessingError(Object error, StackTrace stackTrace)?}) LxWorker<LxStatus<T>>

Available on LxReactive<LxStatus<T>>, provided by the LxStatusReactiveExtensions extension

Specialized listen for async status that allows handling individual states.
named(String name) → R

Available on R, provided by the LxNamingExtension extension

assigns a debug name to this reactive object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Alias for refresh.
override
refresh() → void
Triggers a notification without changing the value.
override
register(String ownerId) → R

Available on R, provided by the LxNamingExtension extension

Links this reactive object to an owner ID.
removeListener(void listener()) → void
Removes a listener.
override
select<R>(R selector(T value)) LxComputed<R>
Creates a specific selection of the state that only updates when the selected value changes.
sensitive() → R

Available on R, provided by the LxNamingExtension extension

Marks this object as containing sensitive data (redacted in logs).
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited