ForEachIterableReducer<State, Action, Environment> extension

Extension providing forEach variants for applying a reducer to each element in a collection.

on
  • Reducer<State, Action, Environment>

Methods

forEach<GlobalState, GlobalAction, GlobalEnvironment, ID>({required Lens<GlobalState, Iterable<State>> stateLens, required Prism<GlobalAction, Action, ID> actionPrism, required ID toID(State state), Environment toLocalEnvironment(ID, GlobalEnvironment)?}) Reducer<GlobalState, GlobalAction, GlobalEnvironment>

Available on Reducer<State, Action, Environment>, provided by the ForEachIterableReducer extension

Applies this reducer to a specific element in a collection, identified by toID.
forEachIndexed<GlobalState, GlobalAction, GlobalEnvironment>({required Lens<GlobalState, Iterable<State>> stateLens, required Prism<GlobalAction, Action, int> actionPrism, required Environment toLocalEnvironment(int, GlobalEnvironment)}) Reducer<GlobalState, GlobalAction, GlobalEnvironment>

Available on Reducer<State, Action, Environment>, provided by the ForEachIterableReducer extension

Like forEach, but identifies elements by their index in the collection rather than a custom ID function.
forEachMap<GlobalState, GlobalAction, GlobalEnvironment, ID>({required Map<ID, State> toMapState(GlobalState), required GlobalState toGlobalState(GlobalState, Map<ID, State>), required (ID, Action)? toLocalAction(GlobalAction), required GlobalAction toGlobalAction(ID, Action), required Environment toLocalEnvironment(ID, GlobalEnvironment)}) Reducer<GlobalState, GlobalAction, GlobalEnvironment>

Available on Reducer<State, Action, Environment>, provided by the ForEachIterableReducer extension

Like forEach, but operates on a Map<ID, State> instead of an Iterable<State>.