I implemented this retry logic imperatively, hopefully this reduces amount of stack memory used vs recursive equivalent
this withRetries function can be used on any async function. The "returned" function from withRetries can access the arguments provided to func via argumentshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
I implemented this retry logic imperatively, hopefully this reduces amount of stack memory used vs recursive equivalent this
withRetries
function can be used on any async function. The "returned" function fromwithRetries
can access the arguments provided tofunc
viaarguments
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments