createDispatcher
void Function()
createDispatcher<
Creates a dispatcher function for a specific action type.
This is a convenience for creating bound action creators inline.
Example:
final dispatchIncrement = createDispatcher(
() => Increment(),
store.dispatch,
);
dispatchIncrement(); // automatically dispatches
Implementation
void Function() createDispatcher<A extends Action>(
A Function() actionCreator,
void Function(Action) dispatch,
) =>
() => dispatch(actionCreator());