MCPcopy
hub / github.com/jeromegn/Backbone.localStorage / destroy

Method destroy

src/localstorage.js:115–123  ·  view source on GitHub ↗

Delete a model from `this.data`, returning it. * @param {Model} model - Model to delete * @returns {Model} Model removed from this.data

(model)

Source from the content-addressed store, hash-verified

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}

Callers 2

syncFunction · 0.80

Calls 3

_removeItemMethod · 0.95
_itemNameMethod · 0.95
saveMethod · 0.95

Tested by

no test coverage detected