-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Add async mapping support with Promises #617
base: main
Are you sure you want to change the base?
Conversation
Add promises to map method Add async handlers to mapAsync and mapArrayAsync
Quality Gate passedIssues Measures |
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. |
Description
As a developer, I want my async mappings to work, so I've added promise support.
Proposed Changes
Implement a new boolean parameter
isAsync
to 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