How to use the vuex/dist/logger function in vuex

To help you get started, we’ve selected a few vuex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ejfrancis / Meteor-Vue-Enterprise-Starter / src / imports / modules / store / client / lib / store.js View on Github external
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
github PacktPublishing / Vuex-Quick-Start-Guide / Chapter06 / store / index.js View on Github external
// 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);
github gardener / dashboard / frontend / src / store / index.js View on Github external
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,
github sokis / vue-vuex-starter-kit / src / store / plugins / index.js View on Github external
}
      switch (payload.__status__) {
        case 'pending':
          break
        case 'success':
          break
        case 'error':
          break
        default:
      }
    })
  }
]

if (__DEV__) {
  plugins.unshift(createLogger())
}

export default plugins