Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Right way to handle a Future that returns an either? #135

Closed
spiffytech opened this issue Jul 19, 2018 · 0 comments
Closed

Right way to handle a Future that returns an either? #135

spiffytech opened this issue Jul 19, 2018 · 0 comments

Comments

@spiffytech
Copy link

I'm calling f = Future.fromPromise(p) on a promise containing an Either. I'd like to do f.map (or something like that) on the result and operate on the right value of the Either, possibly returning another future. I can't find a built-in function that does this, so I'm resorting to f.flatMap((e) => Future.of(() => fn(e))).

Is there a better way to do this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants