wrapEffects<E extends Effect> method
Wraps the feature with an EffectHandler for effects of type E
.
This creates a FeatureEffectWrapper that delegates to the current feature
while adding custom handling for effects of type E
.
handler
: The handler for processing effects of typeE
.
Example:
final wrappedFeature = myFeature.wrap<LogEffect>(
(effect, emit) => print('Log effect: $effect'),
);
Implementation
Feature<State, Msg, Effect> wrapEffects<E extends Effect>(
EffectHandler<E, Msg> handler,
) =>
FeatureEffectWrapper(
feature: this,
handler: handler,
);