Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created December 18, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmiller1990/4889bf2b4378dc0aa9bfe2efdbd5bbda to your computer and use it in GitHub Desktop.
Save lmiller1990/4889bf2b4378dc0aa9bfe2efdbd5bbda to your computer and use it in GitHub Desktop.
thoughts.txt
I am hesitant to tell people how to org their business logic because I don't know about the business.
I would keep vuex actions simple.
import businessLogic from './business-logic.js'
actions = {
getData({ state, commit }) {
const userStatus = await axios.get('/api/user_status')
const processedStatus = complexBusinessLogic.processUserStatus({ status: state.user.status, data: res.data })
commit('UPDATE_USER', processedStatus)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment