dispatch()
The dispatch()
method is used to trigger state updates through predefined actions. It supports both synchronous and asynchronous actions, and can return values from the actions.
Basic Usage
Async Actions
Silent Dispatch
For cases where you want to update state without triggering re-renders:
The return values work the same way with both dispatch
and silentDispatch
.