Closed perfectmak closed 6 months ago
This implements a fix for bimap to await reject promises returned by the left mapping functions.
Currently, the following code:
async function runBimap() { EitherAsync(async ({ throwE }) => { throwE(new Error("error")) }) .bimap(asyncMapFn, asyncMapFn) .caseOf({ Left: (error) => { console.log({ error }) }, Right: (value) => { console.log({ value }) }, }) } await runBimap()
Will output:
Object {error: Promise (resolved)}
This PR fixes it, so that it outputs:
Object {error: Error: error}
Resolves: #678
All good, thanks a lot!
This implements a fix for bimap to await reject promises returned by the left mapping functions.
Currently, the following code:
Will output:
This PR fixes it, so that it outputs:
Resolves: #678