Is there a best practice for having models only show/propagate changes when the data has been successfully saved to the server?
As with Ember-data: update model and show changes only if it was successful, the idea is that the user is making changes to the model that is being used somewhere else on the page that is visible. E.g. A user profile name is displayed in the navbar, and editing it will automatically update it.
The general requirements are:
- Only show/propagate the changes after the data has saved.
- If the server responds with errors from saving, do not show/propagate the change.
- Making changes to a model with errors should clear out the error related to the field, but still not show/propagate the changes.
Changeset and Buffered Proxy doesn’t work here because they both apply changes to the model before saving occurs, and once the changes are applied, all the bindings to the model are updated.