Ember Time Machine
Say you are building a form, what’s the best way to handle the state of an underlying model? How do you revert unwanted changes? Do you use a buffer or take snapshots? What if your model has relationships, and those relationships have relationships?
While Ember is a leading framework for building ambitious applications, it lacks the important ability to manage complex object state. Introducing Ember Time Machine, an addon that challenges this current issue and its limitations with a single command solution.
- Support for both Ember Objects and Arrays, as well as, Ember Data models
- Tracks nested relational changes out of the box (including
- Ability to revert array manipulations as well as object property changes
- No buffer used so all changes are made on the actual model
- Intelligently batches property changes when undoing and redoing
ember install ember-time-machine
Looking for help?
If it is a bug please open an issue on GitHub.
Note: Ember Time Machine can be used with plain objects and arrays. This example is used to show the true potential of this addon
;const user = thisstore;const timeMachine = TimeMachineObject;
/** Basic Manipulations **/timeMachine;/** Nested Array Manipulations **/timeMachine;timeMachine;/** Nested Object Manipulations **/timeMachine;
timeMachine; // Undo the last username changetimeMachine; // Undo the last tasks change. This will undo the newly added task via pushObjecttimeMachine; // Undo the last 2 isCompleted changes on the tasks collectiontimeMachine; // Undo all changes on the settings objecttimeMachine; // Undo all changestimeMachine; // Redo the last undone change to usernametimeMachine; // Redo all changes that have been undone