lastmjs / rezon

MIT License
0 stars 0 forks source link

Replayable actions #2

Open lastmjs opened 8 years ago

lastmjs commented 8 years ago

If we can't have serializable actions that can be replayed, then we definitely won't be as good as Redux.

lastmjs commented 8 years ago

Add a method on the store to startRecording, stopRecording. This will create and store an action object for each mutation to the state. The list can then be retrieved. The list can be passed to a method that will execute actions...maybe even a dispatch method. It can take an action or a list of actions and will apply then to the state in order. The user can just mutate the state through property setters, and actions will be created implicitly, or they can dispatch an action on the store and have it applied. This way we can have replay and stick with the Redux pattern a little more.