Skip to content

Instantly share code, notes, and snippets.

@acacha
Created April 16, 2018 15:57
Show Gist options
  • Save acacha/eb4f340cd8f377be14b18aea169f1d4a to your computer and use it in GitHub Desktop.
Save acacha/eb4f340cd8f377be14b18aea169f1d4a to your computer and use it in GitHub Desktop.
export default {
snackbarShow: state => state.show,
snackbarColor: state => state.color,
snackbarText: state => state.text,
snackbarSubtext: state => state.subText,
snackbarTimeout: state => state.timeout
}
import getters from './getters'
import mutations from './mutations'
const state = {
show: false,
color: 'error',
text: 'An error occurred',
subText: '',
timeout: 6000
}
export default {
state,
getters,
mutations
}
import * as types from '../../mutation-types'
export default {
[ types.SET_SNACKBAR_SHOW ] (state, show) {
state.show = show
},
[ types.SET_SNACKBAR_COLOR ] (state, color) {
state.color = color
},
[ types.SET_SNACKBAR_TEXT ] (state, text) {
state.text = text
},
[ types.SET_SNACKBAR_SUBTEXT ] (state, subText) {
state.subText = subText
},
[ types.SET_SNACKBAR_TIMEOUT ] (state, timeout) {
state.timeout = timeout
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment