dispatch<E> method
void
dispatch<E>(
- E event
dispatch
is a shortcut for context.read<Dispatch<E>>().call(event)
.
Note: please don't omit the type E
when calling this method:
- Bad:
context.dispatch(Increment());
- Good:
context.dispatch<CounterEvent>(Increment());
Since the type E
is needed for looking up Dispatch<E>
.
Implementation
void dispatch<E>(E event) => readDispatch<E>().call(event);