vlki / refresh-fetch

Wrapper around fetch capable of graceful authentication token refreshing.
MIT License
84 stars 12 forks source link

Use of .finally for refreshingTokenPromise #28

Open pke opened 2 years ago

pke commented 2 years ago

Thanks for the library!

I wondered if the refreshingTokenPromise could be rewritten using .finally() instead of creating a promise to reset refreshingTokenPromise to null.

According to all green tests after I did rewrite it seems to work. Anything speaking against using .finally()? And would you accept a PR?