DS#destroyAll
DS#destroyAll(resourceName[, params][, options])
The "D" in "CRUD". Delegate to the destroyAll
method of whichever adapter is being used and eject the matching items from the data store.
Returns a promise.
Arguments
name | type | description |
---|---|---|
resourceName | string | The name of the resource to use. Unnecessary if using the resource directly. |
params | object | Query parameters for selecting which items to destroy. Default: {} . |
options | object | Configuration options. Also passed through to the adapter and (conditionally) to DS.ejectAll . |
options.adapter | string | Override the default adapter. |
options.beforeDestroy | function | Override the default beforeDestroy hook. |
options.afterDestroy | function | Override the default afterDestroy hook. |
options.eagerEject | function | Whether to eject the item from the data store without waiting for a response from the adapter. If an error is thrown the item will be re-injected into the store. Default: false . |
options.notify | function | Whether to call the beforeDestroy and afterDestroy hooks and emit the DS.beforeDestroy and DS.afterDestroy events. Default: true . |
Live Demo
Method Variants
You can call
DS#destroyAll
multiple ways:
DS#destroyAll(resourceName[, params][, options])
Resource#destroyAll([params][, options])
- Where Resource was created byDS#defineResource
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