The foundational interface for all reactive objects in the Levit ecosystem.
LxReactive unifies various reactive sources (variables, futures, streams) under a consistent API for observation and notification.
- Available extensions
Properties
- computedValue → T
-
Available on LxReactive<
Alias for requireValue.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter - errorOrNull → Object?
-
Available on LxReactive<
Returns the current error if the status is LxError, otherwiseLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >null.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- hasValue → bool
-
Available on LxReactive<
Alias for isSuccess.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter - id → int
-
A unique runtime identifier for this reactive instance.
no setter
- isError → bool
-
Available on LxReactive<
ReturnsLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >trueif the status is LxError.no setter - isIdle → bool
-
Available on LxReactive<
ReturnsLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >trueif the status is LxIdle.no setter - isLoading → bool
-
Available on LxReactive<
Alias for isWaiting.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter - isSuccess → bool
-
Available on LxReactive<
ReturnsLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >trueif the status is LxSuccess.no setter - isWaiting → bool
-
Available on LxReactive<
ReturnsLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >trueif the status is LxWaiting.no setter - lastValue → T?
-
Available on LxReactive<
Returns the LxStatus.lastValue (the most recent successful value).LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter - name ↔ String?
-
An optional descriptive name for debugging and profiling.
getter/setter pair
- ownerId ↔ String?
-
The registration key of the owning controller, if applicable.
getter/setter pair
- requireValue → T
-
Available on LxReactive<
Force-retrieves the current value if the status is LxSuccess.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTraceOrNull → StackTrace?
-
Available on LxReactive<
Returns the stack trace if the status is LxError, otherwiseLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >null.no setter -
stream
→ Stream<
T> -
A Stream that emits the latest value whenever it updates.
no setter
- value → T
-
The current state of the reactive object.
no setter
- valueOrNull → T?
-
Available on LxReactive<
Returns the current value if the status is LxSuccess, otherwiseLxStatus< , provided by the LxStatusReactiveExtensions extensionT> >null.no setter -
wait
→ Future<
T> -
Available on LxReactive<
Returns a Future that completes when the operation reaches a terminal state.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> >no setter
Methods
-
addListener(
void listener()) → void -
Registers a synchronous
listenerto be called on every value update. -
close(
) → void - Permanently closes the reactive object and releases all internal resources.
-
listen(
void callback(T value)) → LxWorker< T> -
Available on LxReactive<
ExecutesT> , provided by the LxReactiveWatchExtensions extensioncallbackwhenever this reactive value changes. -
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<
Specialized listen for async status that allows handling individual states.LxStatus< , provided by the LxStatusReactiveExtensions extensionT> > -
named(
String name) → R -
Available on R, provided by the LxNamingExtension extension
Sets the debug name of this reactive object and returns it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → void - Triggers a notification without changing the value.
-
register(
String ownerId) → R -
Available on R, provided by the LxNamingExtension extension
Registers this reactive object with an owner (fluent API). -
removeListener(
void listener()) → void -
Unregisters a previously added
listener. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited