feat(core): Add async mapping support with Promises#617
feat(core): Add async mapping support with Promises#617koenigstag wants to merge 5 commits intonartc:mainfrom
Conversation
Add promises to map method Add async handlers to mapAsync and mapArrayAsync
|
|
Quoting the fake-async docs:
Can someone please explain - why do we need a Node.js Worker thread instead of Promise which are more common? |
Hi @koenigstag. Great work for supporting the async/Promised approach! My opinion is that the fake-async doesn't solve the problem. Long-living non-blocking IO operations may take a lot more time than the fake-async operation that is pushed to the (FIFO) event loop. Your implementation is the appropriate solution, not the suggested fake-async one. |
|
@nartc Sorry to ping you, but since this Pull Request is almost a year old, please review. |
|
I'm closing this PR in favor of #622 |




Description
As a developer, I want my async mappings to work, so I've added promise support.
Proposed Changes
Implement a new boolean parameter
isAsyncto indicate a request for async operations.Add conditional return of Promise which does async mapping operations inside.
Add type safety for return value with typescript conditional types.
Checklist