Destinia / Vision

0 stars 0 forks source link

Add checkpointEnhancer #10

Closed IanChen83 closed 6 years ago

IanChen83 commented 6 years ago

We cannot use redux-undo because not all state change can be mapped to a user history unit, so I create checkpointEnhancer.

It add a checkpoint attribute to redux state to store histories. This history pool is controlled by developers: a history unit is added only when developers want to.

checkpointEnhancer also comes with two action creators: addCheckpoint and jumpCheckpoint. Developers dispatch these actions to add/jump between history units.