Skip to content

Add keepState option to .restore()#26

Open
codynguyen wants to merge 1 commit intomxriverlynn:masterfrom
codynguyen:keepState-option
Open

Add keepState option to .restore()#26
codynguyen wants to merge 1 commit intomxriverlynn:masterfrom
codynguyen:keepState-option

Conversation

@codynguyen
Copy link
Copy Markdown

Hi,

This PR adds the keepState option for the .restore() call.

When you call .restore(), the default behaviour is pretty much the same as an "undo" feature. If I call .restore() 1 time more than I should, the model can be restored to even the point BEFORE it was synced with the server, which is not ideal in most (our) cases.

So this keepState option behaves like a "clear dirty" feature, only the "dirty" changes get cleared. Call .restore({keepState:true}) as many times as you want, and the model will always be restored to the state of the last .store().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant