typescript-monads icon indicating copy to clipboard operation
typescript-monads copied to clipboard

Feature/async mappers Result & Maybe

Open ChrisHadar opened this issue 3 years ago • 7 comments

I've added methods to both Result and Maybe which will automatically unwrap and wrap Promises with more intuitive behavior when mapping async functions

ChrisHadar avatar Nov 29 '21 15:11 ChrisHadar

@ChrisHadar Thanks. It is going to be a little bit before I fully review this. I am swamped at the moment and need to carve some time to think about this and the approach. Thanks!

patrickmichalina avatar Nov 30 '21 22:11 patrickmichalina

This looks really good to me: has tests, no breaking changes, and very useful. You think you would have time @patrickmichalina at some point to review this?

greym0uth avatar Feb 23 '22 04:02 greym0uth

@greym0uth this PR contains async/await which is not something I would want in a lazily evaluated library. Because I see that I have not focused on getting this reviewed. But thanks for the reminder and I will try to pencil it in.

patrickmichalina avatar Feb 23 '22 14:02 patrickmichalina

@patrickmichalina Ah I see yea, perhaps @ChrisHadar could change it to use promises instead of the async/await keywords then?

greym0uth avatar Feb 24 '22 00:02 greym0uth

Also @patrickmichalina why don't you want async/await keywords? It's been a core feature of typescript since 2.1 and since these are TS files anything evaluating them should have async/await keyword support. Rollup can polyfill the build if it doesn't already (I think it translates to promises in the resulting JS already).

greym0uth avatar Mar 03 '22 00:03 greym0uth

Hi folks -- is there anything I can do to help move this PR forward? We're at the point of potentially maintaining our own version of this package in order to support this syntax.

vermiculus avatar Aug 11 '22 13:08 vermiculus

@vermiculus I will try get this over the fence

patrickmichalina avatar Aug 18 '22 13:08 patrickmichalina