diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-12-03 11:49:08 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-12-03 11:49:08 +0300 |
commit | d043fe8065087b7e91b9ee5d97007efb76603c43 (patch) | |
tree | 125160685fd282aadf06c9c81961bc9d1b8017be | |
parent | 9233acea319a49474577d459e615bf79931bfa50 (diff) |
Removed IDE Storage from this Branch
-rw-r--r-- | app/assets/javascripts/ide/stores/ide_storage.js | 76 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/index.js | 2 |
2 files changed, 0 insertions, 78 deletions
diff --git a/app/assets/javascripts/ide/stores/ide_storage.js b/app/assets/javascripts/ide/stores/ide_storage.js deleted file mode 100644 index 71b9dc58cac..00000000000 --- a/app/assets/javascripts/ide/stores/ide_storage.js +++ /dev/null @@ -1,76 +0,0 @@ -/* import merge from 'deepmerge'; -import shvl from 'shvl'; - -export default function(options, storage, key) { - options = options || {}; - storage = options.storage || (window && window.localStorage); - key = options.key || 'vuex'; - - function canWriteStorage(storage) { - try { - storage.setItem('@@', 1); - storage.removeItem('@@'); - return true; - } catch (e) {} - - return false; - } - - function getState(key, storage, value) { - try { - return (value = storage.getItem(key)) && value !== 'undefined' - ? JSON.parse(value) - : undefined; - } catch (err) {} - - return undefined; - } - - function filter() { - return true; - } - - function setState(key, state, storage) { - return storage.setItem(key, JSON.stringify(state)); - } - - function reducer(state, paths) { - return paths.length === 0 - ? state - : paths.reduce(function(substate, path) { - return shvl.set(substate, path, shvl.get(state, path)); - }, {}); - } - - function subscriber(store) { - return function(handler) { - return store.subscribe(handler); - }; - } - - if (!canWriteStorage(storage)) { - throw new Error('Invalid storage instance given'); - } - - return function(store) { - const savedState = shvl.get(options, 'getState', getState)(key, storage); - - if (typeof savedState === 'object' && savedState !== null) { - store.replaceState(merge(store.state, savedState, { - arrayMerge: function (store, saved) { return saved }, - clone: false, - })); - } - - (options.subscriber || subscriber)(store)(function(mutation, state) { - if ((options.filter || filter)(mutation)) { - (options.setState || setState)( - key, - (options.reducer || reducer)(state, options.paths || []), - storage - ); - } - }); - }; -}; -*/ diff --git a/app/assets/javascripts/ide/stores/index.js b/app/assets/javascripts/ide/stores/index.js index 3ad2e828bdc..6ac9bfd8189 100644 --- a/app/assets/javascripts/ide/stores/index.js +++ b/app/assets/javascripts/ide/stores/index.js @@ -4,7 +4,6 @@ import state from './state'; import * as actions from './actions'; import * as getters from './getters'; import mutations from './mutations'; -// import ideStorage from './ide_storage'; Vue.use(Vuex); @@ -13,5 +12,4 @@ export default new Vuex.Store({ actions, mutations, getters, - // plugins: [ideStorage()], }); |