-
Notifications
You must be signed in to change notification settings - Fork 133
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
Creating "invalid" records in memory / triggering persistence #74
Comments
ember-data, for example, uses 'save' to persist data, but as far as I can tell orbit does not have a specific persist command. |
Orbit takes a different approach from ember-data. In ember-data, records maintain state themselves. In orbit, the state of records exists exclusively in sources. In other words, orbit doesn't maintain temporary editing state in record objects which then need to be "saved". I am working on a pattern in ember-orbit to create temporary sources that act as "editing contexts". The idea is that data is copied to a context, edited in isolation, and the operations are then squashed and applied back to the main source in a single transaction (or the context and its changes can be discarded). I think this is a more robust and clean approach to saving records transactionally. I'll be illustrating this pattern in the example project I've mentioned. |
Makes sense, looking forward to seeing the pattern in the example project! |
The concept of "editing contexts" has materialized as store forking and merging, as documented here: http://orbitjs.com/v0.15/guide/data-stores.html#Forking-stores Also, there's an ember-orbit example project that illustrates the concept: https://github.com/cerebris/peeps-ember-orbit |
How can we create a new record in Memory, bind it to a form, and then when all validations pass synchronize it with other sources? Something to do with blocking a transformation until a validation passes?
The text was updated successfully, but these errors were encountered: