Open koenigstag opened 7 months ago
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Quoting the fake-async docs:
Real async support can be achieved by some Isomorphic Worker that would execute the map operations on the Worker thread
Can someone please explain - why do we need a Node.js Worker thread instead of Promise which are more common?
Quoting the fake-async docs:
Real async support can be achieved by some Isomorphic Worker that would execute the map operations on the Worker thread
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.
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