Lx class
The global entry point for the Levit reactive engine.
Lx provides static access to core functionality, including configuration, dependency tracking, and batching.
Constructors
- Lx()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- asyncComputedTrackerZoneKey → Object
-
Internal: Zone key for identifying the active async computed tracker.
no setter
- captureStackTrace ↔ bool
-
Whether to capture stack traces on state changes (performance intensive).
getter/setter pair
- enableWatchMonitoring ↔ bool
-
Global flag to enable or disable performance monitoring for all LxWorker instances.
getter/setter pair
- isBatching → bool
-
Returns
trueif a batching operation is currently in progress.no setter - listenerContext → LxListenerContext?
-
Returns the current active listener context, if any.
no setter
- proxy ↔ LevitReactiveObserver?
-
The active observer capturing dependencies.
getter/setter pair
Static Methods
-
addMiddleware(
LevitReactiveMiddleware middleware) → LevitReactiveMiddleware - Registers a new LevitReactiveMiddleware to intercept or observe state changes.
-
batch<
R> (R callback()) → R -
Executes
callbackin a synchronous batch. -
batchAsync<
R> (Future< R> callback()) → Future<R> -
Executes asynchronous
callbackin a batch. -
clearMiddlewares(
) → void - Removes all active middlewares.
-
containsMiddleware(
LevitReactiveMiddleware middleware) → bool - Checks if a particular middleware is currently registered.
-
enterAsyncScope(
) → void - Internal: Enters an asynchronous tracking scope.
-
exitAsyncScope(
) → void - Internal: Exits an asynchronous tracking scope.
-
removeMiddleware(
LevitReactiveMiddleware middleware) → bool - Unregisters a previously added middleware.
-
runWithContext<
T> (LxListenerContext context, T fn()) → T - The context is passed to LevitReactiveMiddleware.startedListening and LevitReactiveMiddleware.stoppedListening.
-
runWithoutMiddleware(
void action()) → void -
Executes
actionwhile temporarily bypassing all registered middlewares. -
runWithOwner<
T> (String ownerId, T fn()) → T -
Executes
fnwhile associating any created reactive variables withownerId.