josdejong / workerpool

Offload tasks to a pool of workers on node.js and in the browser
Apache License 2.0
2.04k stars 148 forks source link

Unwrap promise types #419

Closed joshkel closed 8 months ago

joshkel commented 8 months ago

A promise's then or catch handler is allowed to return a promise itself; that promise is automatically awaited before invoking the next then or catch in the chain. However, workerpool's types did not reflect this: as a result, promise chains could end up with types like Promise<Promise<number, Error>, any>.

josdejong commented 8 months ago

Good point, thanks!

josdejong commented 8 months ago

Published now in v9.0.3