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

Version Path
activity_notification-2.3.2 spec/rails_app/app/javascript/store/index.js
activity_notification-2.3.1 spec/rails_app/app/javascript/store/index.js
activity_notification-2.3.0 spec/rails_app/app/javascript/store/index.js
activity_notification-2.2.4 spec/rails_app/app/javascript/store/index.js
activity_notification-2.2.3 spec/rails_app/app/javascript/store/index.js
activity_notification-2.2.2 spec/rails_app/app/javascript/store/index.js
activity_notification-2.2.1 spec/rails_app/app/javascript/store/index.js
activity_notification-2.2.0 spec/rails_app/app/javascript/store/index.js
activity_notification-2.1.4 spec/rails_app/app/javascript/store/index.js
amazon-chime-sdk-rails-1.0.0 spec/rails_app/app/javascript/store/index.js
activity_notification-2.1.3 spec/rails_app/app/javascript/store/auth.js
activity_notification-2.1.2 spec/rails_app/app/javascript/store/auth.js
activity_notification-2.1.1 spec/rails_app/app/javascript/store/auth.js
activity_notification-2.1.0 spec/rails_app/app/javascript/store/auth.js