ProxyFeature<State, Msg, Effect> class abstract base

A base class for creating proxy implementations of Feature.

ProxyFeature acts as a wrapper around an existing Feature instance, delegating all functionality to the wrapped feature. This is useful for extending or modifying the behavior of a feature without changing its core implementation.

Example Use Case:

  • Logging: You could wrap a feature to log all messages and effects.
  • Transformation: Apply additional processing to state or effects.

Key Points:

  • Delegates all operations, such as state updates, message acceptance, and effect handling, to the wrapped feature.
  • Can be extended to override specific behavior if needed.
Implemented types
Implementers
Available extensions
Annotations
  • @experimental

Constructors

ProxyFeature({required Feature<State, Msg, Effect> feature})
Creates a ProxyFeature with the specified feature.
const

Properties

disposableEffects List<Effect>
Delegates to the disposableEffects of the wrapped feature.
no setteroverride
effects Stream<Effect>
Delegates effect stream access to the wrapped feature.
no setteroverride
feature Feature<State, Msg, Effect>
The wrapped Feature instance.
final
hashCode int
The hash code for this object.
no setterinherited
initialEffects List<Effect>
Delegates to the initialEffects of the wrapped feature.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → State
Retrieves the current state from the wrapped feature.
no setteroverride
stateStream Stream<State>
Delegates state stream access to the wrapped feature.
no setteroverride

Methods

accept(Msg message) → void
Delegates message handling to the wrapped feature.
override
dispose() Future<void>
Disposes the wrapped feature.
override
init() FutureOr<void>
Initializes the wrapped feature.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(FeatureObserver<S, M, E> observer) Feature<S, M, E>

Available on Feature<S, M, E>, provided by the FeatureObserverWrapperHelper extension

Wraps the feature with the specified observer.
toString() String
A string representation of this object.
inherited
wrapEffects<E extends Effect>(EffectHandler<E, Msg> handler) Feature<State, Msg, Effect>

Available on Feature<State, Msg, Effect>, provided by the EffectHandlerWrapperUtils extension

Wraps the feature with an EffectHandler for effects of type E.

Operators

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