Answer the question
In order to leave comments, you need to log in
How to implement call to api?
Good afternoon.
Please tell me how to correctly implement the execution of requests to the server using jwt, react, redux.
For example, we have a function for getting products "getProducts()" and as I understand it, the scheme should look something like this:
At the moment, I have implemented this behavior by writing a class that requires store(redux'a) and an action to update tokens. But these dependencies confuse me a little.
Answer the question
In order to leave comments, you need to log in
Answer:
https://github.com/axios/axios#interceptors
Implementation:
https://stackoverflow.com/questions/46759321/redux...
Well, they already answered about Axios, I won’t provide links for this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question