Middleware
We now have middleware for updating the state. You can add an optional function to the config for beforeUpdate
and afterUpdate
to have access the the entire store/substate instance. This is great for making saves to local state, stopping state updates if you need to, etc.