We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when I use axios in many modules
// each module has to import import axios from 'axios' export default { ... actions: { getUsers ({ commit }) { axios.get('/users').then(data => { commit('users', data) }) } } }
If the actions first param context is configurable, it could be like this, the axios may be db, model or socket
// in store/index import axios from 'axios' const store = new Vuex.Store({ context: { axios }, ... modules: { ... } }) // in module/user export default { ..., actions: { getUsers ({ axios, commit }) { axios.get('/users').then(data => { commit('users', data) }) } } }
I read src/store.js and find that the context is not configurable.
The text was updated successfully, but these errors were encountered:
There was this kind of discussion in the past and we didn't introduce the feature that can be inject something in the action context. See #571
You can use the action enhancer approach to do that.
Sorry, something went wrong.
I read #571, thank you
No branches or pull requests
What problem does this feature solve?
when I use axios in many modules
What does the proposed API look like?
If the actions first param context is configurable, it could be like this,
the axios may be db, model or socket
I read src/store.js and find that the context is not configurable.
The text was updated successfully, but these errors were encountered: