Senica Gonzalez
Senica Gonzalez

Reputation: 8192

Backbone.js reset() Does it destroy models?

If I call Backbone.Collection.reset() will it destroy() each model in the collection or are they still held in memory?

Upvotes: 2

Views: 493

Answers (1)

Dima Bildin
Dima Bildin

Reputation: 1553

It does not call .destroy() for each model, it would be odd.. The destroy() method calls a DELETE ajax request usually and .reset() does nothing with syncing data to server, it clears the collection, so if the collection was the only place models were stored, we can say they not still held in memory

Upvotes: 4

Related Questions