Thanks for your advice. That's a nice way of doing it.
I already use interceptors for listening for the 401 response status.
Although i said that's something annoying the verbosity of axios is at the same time where axios shines. We can take as an advantage the verbosity of the response and use it to enrich our logs
I've been reading about Axios interceptors and it seems like a cool way to address not only HTTP errors but async problems that can pop up
You're right! You can also use request interceptors to add custom headers like an authorization token in every single request, removing the need to write repetitive code
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.