Skip to content

Commit

Permalink
Simulate fetch for mock collections
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed May 12, 2017
1 parent ac9eaff commit 9096afd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,12 @@ var main = function() {
}

if (content instanceof Array) {
// on-the-fly collection, so populate from array
Alloy.Collections[name].reset(content);
// and override fetch to trigger a change event
Alloy.Collections[name].fetch = function(){
Alloy.Collections[name].trigger("change");
};
} else {
throw "No Array specified for createCollection";
}
Expand Down

0 comments on commit 9096afd

Please sign in to comment.