yapplabs / ember-buffered-proxy

An Ember Proxy the enables change buffering
MIT License
166 stars 31 forks source link

[Enhancement] Adding the ability to apply or discard a subset of keys #2

Closed thoov closed 9 years ago

thoov commented 9 years ago

We have a fair complex form that we back with the buffered proxy and found that we could "stage" a bunch of changes inside of the buffer and then when the user submits the form apply only the subset that should be persisted instead of the whole buffer.

actions: {
  submit: function() {
    this.applyBufferedChanges(this.get('keysToApply'));
    ...
  }
}
...

keysToApply: function() {
  // logic to determine which keys to persisted
}.property()
stefanpenner commented 9 years ago

I like this idea, I left some suggestions to simplify the implementation.

stefanpenner commented 9 years ago

could you also add an tidbit in the readme?

thoov commented 9 years ago

Thanks for the comments and I will address them :+1:. And yes I will update the readme

thoov commented 9 years ago

@stefanpenner Anything here you still want updated?

stefanpenner commented 9 years ago

Nope looks great. Thanks :)