Utility for Wrapping and Proxying Async and Sync Functions in Non-Effect Libraries
In the real world we have to interact with non effect libraries, and often need to wrap classes/objects function into Effect.tryPromise, Effect.try etc.
It would be nice to have some utilities that could easily wrap an object and simply proxy the async functions, and sync functions, and have a general error be thrown when these fail:
Is this a good idea? of course i know that a specific wrapper is better, but it's a lot of work
I can image that we could expand the WrapAsyncMethods and asyncMethodsProxyHandler to have options to define how to do it, e.g.:
It would be nice to have some utilities that could easily wrap an object and simply proxy the async functions, and sync functions, and have a general error be thrown when these fail:
Is this a good idea? of course i know that a specific wrapper is better, but it's a lot of work
I can image that we could expand the WrapAsyncMethods and asyncMethodsProxyHandler to have options to define how to do it, e.g.:
