Created
April 8, 2018 20:13
-
-
Save michalbujalski/9d417a2141b4507519635c80b2edf742 to your computer and use it in GitHub Desktop.
Setup store for firebase auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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