Skip to content
Advertisement

Execute function after every post request

Using Axios is there a way to “hook” a function to every post request?

I have a ‘notification’ module in Vue.js store, which stores API responses, so I need to call an updateResponse method in every post request .then

Advertisement

Answer

Just use Axios interceptors

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement