-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Allow wrapping function like mem
does
#61
Comments
Sure. It should probably be a named export though. Naming suggestions?
|
I was looking for something to handle retries and i found this and node-retry. node-retry has I ended up going with p-retry due to ts support, but |
mem
mem
does
@fregante Are you suggesting something like this? export function wrap(input, options) {
return () => pRetry(input, options);
} to be used like: const runMeRetried = wrap(runMeNow, bigOptionsObject)
function init() {
runMeRetried().then(console.log)
}
init(); |
Yes that's it. You make it look simple 😅 the only bothersome part that prevents me from doing exactly that would be the types |
Instead of passing a function to immediately call it, I'd like to wrap a function to be used later. From:
to:
The text was updated successfully, but these errors were encountered: