Closed mrmurphy closed 7 years ago
Interesting idea, definitely worth more thought. I'll be out of the country for a few weeks, so might not be too responsive.
I'd say try it out for a few weeks as a typescript module augmentation and see how you like it.
Sounds great! Have fun on your trip :).
Have you tried this out? How has it worked out for you?
I think I actually think I ended up going with straight promises instead of futures, so I didn't get to test it out very much. I hope you had a nice trip!
Got it, thanks for following up.
Futures are definitely my personally least used abstraction. Guess that means that they need more work. 😄
Going to close this for now, please re-open if you work on this again.
Add Future#flatMapP for continuing a Future chain by returning a Promise instead of another Future. This makes working with async functions inside of futures a little more clean.
I just ended up wanting this while working today and added it in. I'm not sure whether it fits with your vision of what you want the API to look like, but it does make Futures a bit easier to use with async functions, so user doesn't have to wrap any async functions in a
flatMap
with a call toFuture.create
.