Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
ember-auto-save
Advanced tools
Changelog
v0.0.2 2016-06-19
Move the save()
method to its own module.
Import the save()
method into the AutoSaveMixin
.
Readme
An Ember-cli addon that provides auto-save functionality for Ember applications.
http://lozjackson.github.io/ember-auto-save/
ember install ember-auto-save
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.
Example:
controller.js
import Ember from 'ember';
import autoSaveProxy from 'ember-auto-save';
export default Ember.Controller.extend({
autoSaveProxy,
model: model
});
template.hbs
{{input value=autoSaveProxy.name}}
You can use the AutoSaveComponent to wrap a model
and provide an autoSaveProxy
object.
{{#auto-save model=model as |autoSaveProxy|}}
{{input value=autoSaveProxy.name}}
{{/auto-save}}
The AutoSaveMixin overrides the setUnknownProperty
method, and
triggers the save
method when properties are set on the model
.
The example below show how you can create your own autoSaveProxy
object.
import AutoSaveMixin from 'ember-auto-save/mixins/auto-save';
let AutoSaveProxy = Ember.ObjectProxy.extend(AutoSaveMixin);
let autoSaveProxy = AutoSaveProxy.create({
content: this.get('model')
});
Use the save()
method to save the model
using the
Ember.js debounce()
method.
import { save } from `ember-auto-save`
save( model );
Optionally, you can provide a time to wait before applying the method. If no time value is specified then the default of 2000 (2 seconds) will be used.
// save the model after 5 seconds
save( model, 5000 );
FAQs
An Ember-cli addon that provides auto-save functionality for Ember applications.
We found that ember-auto-save demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).