Skip to content

Commit

Permalink
IndexMixin: set fetchStatus property to 'fetched' when fetch completes
Browse files Browse the repository at this point in the history
The implementation of fetch does not call into BaseCollection's,
so at least the status has to be updated the same way to actually
prevent re-fetching in repeated calls of applyToAll etc.
  • Loading branch information
Mikhail Zabaluev committed Sep 7, 2015
1 parent 2c7574d commit 3a715c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/collections/index_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ var IndexMixin = _.extend({}, IndexedCollectionMixin, {
if (!options.skipModelsFetch) {
fns.push(_.bind(this.modelsFetch, this, options));
}
return sequence(fns);
return sequence(fns)
.with(this)
.then(function() {
this.fetchStatus = 'fetched';
});
},

// deprecated
Expand Down

0 comments on commit 3a715c3

Please sign in to comment.