Slice your heavy task in light chunk and run them asynchronously.
yarn add @jaeseokk/chunk-scheduler
import chunkScheduler from '@jaeseokk/chunk-scheduler'
const scheduler = createScheduler()
function* chunkGenerator() {
let result = 0
for (let i = 0; i < 10; i++) {
result += i
yield
}
return result
}
scheduler.runChunks(chunkGenerator())
MIT as always