(node:18886) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
at /c/repositories/proforto/Profortool/grand-bazaar/packages/tricorp-materializer/node_modules/debounce-promise/dist/index.js:43:23
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 0)
const debounce = require('debounce-promise')
async function doIt(name) {
console.log('name', name) // [ [ 'first' ], [ 'second' ], [ 'third' ] ]
// return name // When returning a value, no error is thrown
}
const doItPlus = debounce(doIt, 100, { accumulate: true })
async function main() {
const promises = [
doItPlus('first'),
doItPlus('second'),
doItPlus('third'),
]
await Promise.all(promises)
}
main()