Skip to content

Commit

Permalink
update auto-save util
Browse files Browse the repository at this point in the history
  • Loading branch information
lozjackson committed Jun 18, 2016
1 parent c324936 commit 0b72c5a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions addon/utils/auto-save.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ const AutoSaveProxy = Ember.ObjectProxy.extend(AutoSaveMixin);
/**
## AutoSaveProxy
This is a computed property that will auto-save the underlying `model`.
This is a computed property that provides an `autoSaveProxy` object. The `autoSaveProxy`
object will proxy all requests to the `model` property. Setting properties on the
`autoSaveProxy` object will be automatically saved.
Use this property in a controller or component. Set your `model` on the
controller, then create an `autoSaveProxy` object for the model.
When you update the proxy object the model will be saved automatically.
Use this property in a controller or component. Set your `model` on the
controller, then create an `autoSaveProxy` object for the model.
Example:
Expand All @@ -38,13 +39,9 @@ const AutoSaveProxy = Ember.ObjectProxy.extend(AutoSaveMixin);
template.hbs
```
{{component model=autoSaveProxy}}
{{input value=autoSaveProxy.name}}
```
The `autoSaveProxy` object will proxy all requests to the `model` property
Setting properties on the `autoSaveProxy` object will be automatically saved.
@property autoSaveProxy
@type {Object} Ember.ObjectProxy
*/
Expand All @@ -66,7 +63,7 @@ export default computed('model', function() {
```
import { save } from `ember-auto-save/utils/auto-save`
import { save } from `ember-auto-save`
save( model );
```
Expand Down

0 comments on commit 0b72c5a

Please sign in to comment.