Reducer<State, Action, Environment>.emit constructor

Reducer<State, Action, Environment>.emit(
  1. Effect<Action> emitter(
    1. State state,
    2. Action action,
    3. Environment env
    )
)

Creates a reducer that emits effects without changing state.

Use this for side-effect-only responses to actions (e.g., analytics, logging, navigation).

Implementation

factory Reducer.emit(
  Effect<Action> Function(State state, Action action, Environment env) emitter,
) =>
    Reducer(
      reduce: (state, action, env) => (
        state: state,
        effect: emitter(state, action, env),
      ),
    );