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
-
- Feature<
State, Msg, Effect>
- Feature<
- 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<
Wraps the feature with the specifiedS, M, E> , provided by the FeatureObserverWrapperHelper extensionobserver. -
toString(
) → String -
A string representation of this object.
inherited
-
wrapEffects<
E extends Effect> (EffectHandler< E, Msg> handler) → Feature<State, Msg, Effect> -
Available on Feature<
Wraps the feature with an EffectHandler for effects of typeState, Msg, Effect> , provided by the EffectHandlerWrapperUtils extensionE.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited