Sha256: b731f29a26b4f3d7d9ad17d6914684c618a1f223ed2c8d7f3108acfc3261082a
Contents?: true
Size: 820 Bytes
Versions: 14
Compression:
Stored size: 820 Bytes
Contents
import Vue from 'vue' import Vuex from 'vuex' import createPersistedState from "vuex-persistedstate" Vue.use(Vuex) export default new Vuex.Store({ state: { signedInStatus: false, currentUser: null, authHeaders: {} }, mutations: { signIn(state, { user, authHeaders }) { state.currentUser = user; state.authHeaders = authHeaders; state.signedInStatus = true; }, signOut(state) { state.signedInStatus = false; state.currentUser = null; state.authHeaders = {}; } }, getters: { userSignedIn(state) { return state.signedInStatus; }, currentUser(state) { return state.currentUser; }, authHeaders(state) { return state.authHeaders; } }, plugins: [createPersistedState({storage: window.sessionStorage})] });
Version data entries
14 entries across 14 versions & 2 rubygems