Delete a model from `this.data`, returning it. * @param {Model} model - Model to delete * @returns {Model} Model removed from this.data
(model)
| 113 | * @returns {Model} Model removed from this.data |
| 114 | */ |
| 115 | destroy(model) { |
| 116 | this._removeItem(this._itemName(model.id)); |
| 117 | const newRecords = without(this.records, model); |
| 118 | |
| 119 | this.records = newRecords; |
| 120 | this.save(); |
| 121 | |
| 122 | return model; |
| 123 | } |
| 124 | |
| 125 | /** Clear localStorage for a collection |
| 126 | * @returns {undefined} |
no test coverage detected