Skip to content
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

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

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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant