DS#eject
DS#eject(resourceName, id[, options])
Eject from the store the item of the specified resource that has the given primary key. Ejection only removes items from the data store and does not attempt to destroy items via an adapter.
Returns the ejected item if it was ejected.
Arguments
name | type | description |
---|---|---|
resourceName | string | The name of the resource to use. Unnecessary if using the resource directly. |
id | string or number | The primary key of the item to eject. |
options | object | Configuration options. |
options.notify | boolean | Whether to call the beforeEject and afterEject hooks and emit the DS.eject event. Default: true . |
Live Demo
Method Variants
You can call
DS#eject
multiple ways:
DS#eject(resourceName, id[, options])
Resource#eject(id[, options])
- Where Resource was created byDS#defineResource
Instance#DSEject([, options])
- Where Instance is an instance of a Resource. Note this ejects the item from the store, but you still have a reference to the object, so the object won't get garbage collected just yet.
Need help?
Want more examples or have a question? Ask on the Slack channel or post on the mailing list then we'll get your question answered and probably update this wiki.
Updated less than a minute ago