Skip to content

Allow wrapping function like mem does #61

@fregante

Description

@fregante

Instead of passing a function to immediately call it, I'd like to wrap a function to be used later. From:

function runMeNow() {}
function init() {
	pRetry(runMeNow, {
		bigOptionsObject
	}).then(console.log)
}

init();

to:

const runMeRetried = pRetry.wrap(runMeNow, {
	bigOptionsObject
});
function init() {
	runMeRetried.then(console.log)
}

init();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions