Skip to content

Instantly share code, notes, and snippets.

@FbN
Created November 1, 2019 13:14
Show Gist options
  • Save FbN/32bebf5528ad3a478d1b4ba4ecf20266 to your computer and use it in GitHub Desktop.
Save FbN/32bebf5528ad3a478d1b4ba4ecf20266 to your computer and use it in GitHub Desktop.
Imperative Version
function todoList (deferred) {
const list = []
let old = {}
for (let i = 0; i < config.iterations; i++) {
const t = todo()
old = t.id % 4 === 0 ? { ...t } : old
t.old = { ...old }
list.push(t)
}
return deferred.resolve(list)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment