Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keepState option to .restore() #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codynguyen
Copy link

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