Skip to content

Instantly share code, notes, and snippets.

@michalbujalski
Created April 8, 2018 20:13
Show Gist options
  • Save michalbujalski/9d417a2141b4507519635c80b2edf742 to your computer and use it in GitHub Desktop.
Save michalbujalski/9d417a2141b4507519635c80b2edf742 to your computer and use it in GitHub Desktop.
Setup store for firebase auth
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
user: null
}
const mutations = {
updateUser (state, { user }) {
Vue.set(state, 'user', user)
}
}
const getters = {
user: state => state.user
}
const actions = {
}
const store = new Vuex.Store({
state,
mutations,
actions,
getters
})
export default store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment