can-connect icon indicating copy to clipboard operation
can-connect copied to clipboard

Consider possibilities for redux-like undo/redo abilities

Open DesignByOnyx opened this issue 8 years ago • 3 comments
trafficstars

Redux requires you to architect your app with a god-like state "container" - components must be aware of this container and the container must know about all of the operations which can take place within your app. One of the convenient side affects of this architecture is the ability to fast-forward, rewind, and otherwise undo and replay state changes as they all funnel through one place.

can-connect on the other hand allows components to be developed in isolation and establish their own communication with the data store - no two components need to know about one another, nor does the app need to know about any component state. But by using a connect'd data layer all of these "god-like" features are done for you implicitly (magically). It would be nice then to have a mechanism to track the changes in objects and be able to undo or replay them in the same order they happened.

DesignByOnyx avatar Jan 14 '17 02:01 DesignByOnyx

What is the use case? Debugging?

Sent from my iPhone

On Jan 13, 2017, at 8:00 PM, Ryan Wheale [email protected] wrote:

Redux requires you to architect your app with a god-like state "container" - components must be aware of this container and the container must know about all of the operations which can take place within your app. One of the convenient side affects of this architecture is the ability to fast-forward, rewind, and otherwise undo and replay state changes as they all funnel through one place.

can-connect on the other hand allows components to be developed in isolation and establish their own communication with the data store - no two components need to know about one another, nor does the app need to know about any component state. However, by using a connect'd data layer all of these "god-like" features are done for you implicitly (magically). It would be nice then to have a mechanism to track the changes in objects and be able to undo or them in the same order they happened.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

justinbmeyer avatar Jan 14 '17 05:01 justinbmeyer

Debugging could definitely benefit as change deltas can be stored and used to replay the state of an app leading up to a bug. There's always the obvious benefits of undo/redo - something which is typically complex could now just be there for you to use at your leisure. And as redux-style data layers are becoming more popular, it'd be nice to say "we can do that too".

DesignByOnyx avatar Jan 14 '17 21:01 DesignByOnyx

I think this belongs in can-define. We could track property changes and restore to previous states.

Sent from my iPhone

On Jan 14, 2017, at 3:57 PM, Ryan Wheale [email protected] wrote:

Debugging could definitely benefit as change deltas can be stored and used to replay the state of an app leading up to a bug. There's always the obvious benefits of undo/redo - something which is typically complex could now just be there for you to use at your leisure. And as redux-style data layers are becoming more popular, it'd be nice to say "we can do that too".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

justinbmeyer avatar Jan 14 '17 22:01 justinbmeyer