jitdb icon indicating copy to clipboard operation
jitdb copied to clipboard

Buggy multicb

Open arj03 opened this issue 3 years ago • 1 comments

const multicb = require('multicb')
const done = multicb({ pluck: 1 })

function callAsync(cb) {
  setTimeout(() => {
    console.log("inside async")
    cb()
  }, 100)
}

callAsync(done())

done((err, res) => {
  console.log('yo')
})
done((err, res) => {
  console.log('yo2')
})

=>

inside async
yo2

Problem is here discovered in this

arj03 avatar Apr 02 '22 09:04 arj03

remove callAsync and yo + yo2 is printed.

arj03 avatar Apr 02 '22 09:04 arj03