How I can clear the cache of relational Backbone? relational backbone remembers the previous values after fetch
Asked
Active
Viewed 1,197 times
3 Answers
0
Backbone.Relational.store.reset();
models.fetch({
data: {...},
reset: true,
success: function(models) {...}
});
Thanks @jax.

mstafkmx
- 419
- 5
- 17
0
Backbone.Relational.store.reset()
removes also registered relations. If you want to clear the cache of stored models only, use this:
Backbone.Relational.store._collections.forEach(function each(collection) {
collection.reset();
});

Hugo Mallet
- 533
- 5
- 8