wrapEffects<E extends Effect> method

Feature<State, Msg, Effect> wrapEffects<E extends Effect>(
  1. EffectHandler<E, Msg> handler
)

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 type E.

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,
    );