Skip to content

Instantly share code, notes, and snippets.

@toddzebert
Created March 27, 2017 03:59
Show Gist options
  • Save toddzebert/bcd849a48676256eef8a795f8f03cfff to your computer and use it in GitHub Desktop.
Save toddzebert/bcd849a48676256eef8a795f8f03cfff to your computer and use it in GitHub Desktop.
getFeed code for use with simAsync.js
// requires https://gist.github.com/toddzebert/996e297c1c081d19378eaf5f29dc75bb
var getFeed = function(data) {
// create a closure
const feed = function () {
const a = [];
for (let i = randInt(4, 2); i; i--) {
a.push(randInt(90, 1));
}
data.feed = a;
return data;
};
return simAsync(feed);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment