Skip to content

Instantly share code, notes, and snippets.

@itacirgabral
Created May 10, 2018 01:34
Show Gist options
  • Save itacirgabral/9e30d748a602153bf51de454daea682a to your computer and use it in GitHub Desktop.
Save itacirgabral/9e30d748a602153bf51de454daea682a to your computer and use it in GitHub Desktop.
function serial(obj, i, farr) {
if (i === farr.length) {
console.log(obj)
} else {
farr[i](obj, e => {
serial(e, i + 1, farr)
})
}
}
function paralelo (obj, farr) {
let i = 0
const output = {obj0: obj}
farr.forEach(e => {
e(obj, ee => {
output[e.name] = ee
i++
if (i === farr.length) {
console.log(output)
}
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment