Currently the axiosRateLimit function is the only export from the module, but I would like to be able to share rate-limiting between axios clients. That is, I'd like to be able to do something like this:
So that both sheet1 and sheet2 are rate-limited as if they were a single rate limited axios client. I.e. if two requests are done in the same second on client1, then a third request in the same second for client2 would be rate-limited into the next second.
From what I can see in the code, it's almost ready for that, as the axios parameter in the constructor for AxiosRateLimit is only used for the .enable() call, and in there it's only used to .use() the interceptors. And though it stores the return values of the .use() calls, it doesn't actually do anything with them.
Currently the
axiosRateLimit
function is the only export from the module, but I would like to be able to share rate-limiting between axios clients. That is, I'd like to be able to do something like this:So that both
sheet1
andsheet2
are rate-limited as if they were a single rate limited axios client. I.e. if two requests are done in the same second onclient1
, then a third request in the same second forclient2
would be rate-limited into the next second.From what I can see in the code, it's almost ready for that, as the
axios
parameter in the constructor forAxiosRateLimit
is only used for the.enable()
call, and in there it's only used to.use()
the interceptors. And though it stores the return values of the.use()
calls, it doesn't actually do anything with them.