Nubescope/reduxable

Implement lifecycle hooks

Opened this issue · 0 comments

Implement lifecycle hooks for:

  • component mount (will/did)
  • state update (will/did)
  • action dispatch (will/did)

All should be local, meaning that will only be triggered with changes in each component. Then we can discuss if some global hooks are needed.

Also we should discuss what you can (and can not) do into each different hook. So far I can think in these rules:

  • You can call a reducer in componentDidMount / stateDidUpdate
  • You can NOT call a reducer in componentWillMount / stateWillUpdate / actionWillDispatch / actionDidDispatch

In the case of actionWillDispatch and stateWillUpdate, see if should be possible to prevent them.