Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Vue from 'vue'
import Vuex from 'vuex'
import feathersVuex from 'feathers-vuex'
import feathers from '../api/feathers' // Cannot load this as a plugin :-(
import example from './module-example'
const { service, auth } = feathersVuex(feathers, {
idField: 'id', // The field in each record that will contain the id
autoRemove: false, // automatically remove records missing from responses (only use with feathers-rest)
nameStyle: 'short', // Determines the source of the module name. 'short' or 'path'
enableEvents: true // Set to false to explicitly disable socket event handlers.
})
Vue.use(Vuex)
/*
* If not building with SSR mode, you can
* directly export the Store instantiation
*/
export default function (/* { ssrContext } */) {
const Store = new Vuex.Store({
modules: {
import Vue from 'vue'
import Vuex from 'vuex'
import feathersVuex from 'feathers-vuex'
import feathers from '../api/feathers' // Cannot load this as a plugin :-(
const { service, auth } = feathersVuex(feathers, {
idField: 'id', // The field in each record that will contain the id
autoRemove: false, // automatically remove records missing from responses (only use with feathers-rest)
nameStyle: 'short', // Determines the source of the module name. 'short' or 'path'
enableEvents: true // Set to false to explicitly disable socket event handlers.
})
Vue.use(Vuex)
/*
* If not building with SSR mode, you can
* directly export the Store instantiation
*/
export default function (/* { ssrContext } */) {
const Store = new Vuex.Store({
modules: {
import feathersClient from '../feathers-client';
import feathersVuex, { initAuth } from 'feathers-vuex';
const { service, auth } = feathersVuex(feathersClient, { idField: '_id' });
export const state = () => ({});
export const mutations = {};
export const actions = {
nuxtServerInit({ commit, dispatch }, { req }) {
return initAuth({
commit,
dispatch,
req,
moduleName: 'auth',
cookieName: 'feathers-jwt'
})
}
};