ZenithMiddleware<T> class abstract

Interceptor interface for observing, sanitizing, transforming, or canceling value mutations on a ZenithNode.

Implement this interface to create middleware for logging, value clamping, bearer token injection, analytics, or validation.

class ClampingMiddleware extends ZenithMiddleware<int> {
  @override
  int? onWillSet(ZenithNode<int> node, int currentValue, int newValue) {
    return newValue.clamp(0, 100);
  }
}

Constructors

ZenithMiddleware()

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
onDidSet(ZenithNode<T> node, T value) → void
Called after value has been successfully assigned to node and subscribers have been notified.
onWillSet(ZenithNode<T> node, T currentValue, T newValue) → T?
Called before newValue is assigned to node.
toString() → String
A string representation of this object.
inherited

Operators

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