https://github.com/movableink/buffered-proxy
Ember mixin for buffering changes to an ObjectProxy
https://github.com/movableink/buffered-proxy
Last synced: 5 months ago
JSON representation
Ember mixin for buffering changes to an ObjectProxy
- Host: GitHub
- URL: https://github.com/movableink/buffered-proxy
- Owner: movableink
- Created: 2014-04-05T04:01:52.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-22T18:55:27.000Z (over 11 years ago)
- Last Synced: 2024-11-09T22:56:43.514Z (about 1 year ago)
- Language: JavaScript
- Size: 158 KB
- Stars: 14
- Watchers: 55
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
BufferedProxy
=============
Proxy object for easy rollbacks.
Usage
=====
```
var FooController = Ember.ObjectController.extend({
bufferedContent: function() {
return Em.ObjectProxy.extend(BufferedProxy).create({
content: this.get('content')
});
}.property('content'),
actions: {
save: function() {
this.get('bufferedContent').applyBufferedChanges();
},
cancel: function() {
this.get('bufferedContent').discardBufferedChanges();
}
}
});
```
About
=====
Written by Kris Selden for Yapp Labs, published by Luke Melia.