Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Store } from 'vuex';
import createLogger from 'vuex/dist/logger';
// vuex store modules
import { counterStoreModule } from '/src/imports/modules/counter/client/state/counter-store';
import { authStoreModule } from '/src/imports/modules/auth/client/state/auth-store';
import { layoutStoreModule } from '/src/imports/modules/layout/client/state/layout-store';
const plugins = [];
if (['production', 'test'].indexOf(process.env.NODE_ENV) === -1) {
plugins.push(createLogger());
}
const createStore = () => {
const newStore = new Store({
plugins,
modules: {
counter: counterStoreModule,
auth: authStoreModule,
layout: layoutStoreModule
}
});
return newStore;
};
export {
createStore
// src/store/index.js
import Vuex from 'vuex';
import Vue from 'vue';
import { sync } from 'vuex-router-sync';
import createLogger from 'vuex/dist/logger';
import createPersistedState from 'vuex-persistedstate';
import { mutations } from '../../Chapter04/store/mutations';
import actions from '../../Chapter04/store/actions';
import plugins from './plugins';
import router from '../router';
Vue.use(Vuex);
const debug = process.env.NODE_ENV !== 'production';
if (debug) {
plugins.push(createLogger({}));
}
plugins.push(createPersistedState());
const store = new Vuex.Store({
state: {
noteList: [],
currentNote: { title: '', content: '' },
editNote: null,
editIndex: -1,
},
mutations,
actions,
strict: debug,
plugins,
});
sync(store, router);
import cloudProfiles from './modules/cloudProfiles'
import domains from './modules/domains'
import projects from './modules/projects'
import members from './modules/members'
import infrastructureSecrets from './modules/infrastructureSecrets'
import journals from './modules/journals'
import semver from 'semver'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test'
// plugins
const plugins = []
if (debug) {
plugins.push(createLogger())
}
// initial state
const state = {
cfg: null,
ready: false,
namespace: null,
onlyShootsWithIssues: true,
sidebar: true,
user: null,
redirectPath: null,
loading: false,
alert: null,
alertBanner: null,
shootsLoading: false,
websocketConnectionError: null,
}
switch (payload.__status__) {
case 'pending':
break
case 'success':
break
case 'error':
break
default:
}
})
}
]
if (__DEV__) {
plugins.unshift(createLogger())
}
export default plugins