Closed amk221 closed 9 years ago
@amk221 do you have any links to that? I'm looking for a robust way to implement “delay changes until the user clicks save” and buffered-proxy looks exactly like what I need. Your comment scared me a little though.
You can accomplish the same thing by snapshotting the data and delay applying the changes until the user saves. I've had success with this approach, by copying the data to a forked model and on saving the forked model, pushing the data back to the original model. This has the benefit of being able to rollback the model on a cancelled failed save (including the relationships).
I would suggest moving away from buffered-proxy.
Alright, thanks for answering so fast.
Do you have a gist of the snapshotting technique? The thing I like about the buffered proxy technique is the ability to mix in a validator into the proxy and store meta info on it. Would this still be possible?
This was a quick sample, it is kind of basic https://github.com/krisselden/draft-sample
Thanks, bit of a shame to have to lose the nice applyChanges() which avoided having to manually transfer the properties.
this sample code have utils or an addon that makes it easier, less code
I listened to the frontside podcast (June) and learned that ObjectPoxy's are on the way out of Ember.
Even after the move from two way bindings to one way bindings, buffered proxy's are still useful (e.g. to collect form data, which will eventually be transferred to a model).
How will this affect the ember-buffered-proxy project?