Closed danherd closed 6 years ago
Hmm. It would seem 'resetMiddleware' basically wipes every middleware change you've made. How can I add a middleware for a particular action, them remove it immediately afterwards?
Ignore this. I now know more about how the middleware works!
Here's the relevant code:
store/utils/json-api.js
store/modules/user.js (truncated)
As the API call returns an error, I would expect to see the payload in the console, but instead I get the 'TypeError: Cannot read property 'pointer' of undefined' from line 46 of res-errors.js, leading me to believe the call to 'js.replaceMiddleware' in the first file is not actually doing anything. The weird thing is, the calls to 'js.insertMiddlewareBefore' and 'js.insertMiddlewareAfter' work fine.
So, is this a bug, or am I doing something wrong?