Closed atamon closed 6 years ago
Yes, I'd be happy to accept a PR for this.
Nice find!
Hey @atamon
Would you still like to send a PR for this?
Hi @tim-kos! Of course, it slipped my mind back a year ago. Please see #52 for what I had in mind back then.
Fixed in https://github.com/tim-kos/node-retry/pull/52#pullrequestreview-107541811 Thank you!
Hi,
I found that the .wrap() function acts oddly when being called as follows:
Both obj.fn1() and obj.fn2() will now call the same original function due to this line https://github.com/tim-kos/node-retry/blob/master/lib/retry.js#L76. The variable
original
will be hoisted to the top of the function declaration ofwrap
.I'm going to solve my specific use-case by calling wrap twice, once per function instead. But if you'd like to, I could try to get back with a PR for solving this.