store.js 530 Bytes
Newer Older
duanledexianxianxian's avatar
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import config from '@/config';
import engine from 'store/src/store-engine';
import localStorage from 'store/storages/localStorage';

import defaults from 'store/plugins/defaults';
import expire from 'store/plugins/expire';

const { storeNameSpace } = config;

const storages = [localStorage];
const plugins = [defaults, expire];

if (window && !window.localStorage) {
  // eslint-disable-next-line no-console
  console.error('localStorage对象不存在');
}

export default engine.createStore(storages, plugins, storeNameSpace);