newsiberian / apollo-link-token-refresh

Apollo Link that performs access tokens (JWT) renew
MIT License
337 stars 45 forks source link

Concurrent requests #10

Open nicoCalvo opened 5 years ago

nicoCalvo commented 5 years ago

How you handle concurrent requests in order to avoid multiple token renewal process to be triggered?

guiccbr commented 5 years ago

It queues requests according to the isFetching state. See: https://github.com/newsiberian/apollo-link-token-refresh/blob/b4c12027137586fd4e65442e478d662144068fdd/src/tokenRefreshLink.ts#L139