refactor: lazy-load simplemde + minimal lodash

This commit is contained in:
NGPixel
2017-05-27 22:24:46 -04:00
parent 8eaa69ce78
commit ebe288a5b2
10 changed files with 332 additions and 172 deletions

View File

@@ -1,6 +1,6 @@
'use strict'
import _ from 'lodash'
import debounce from 'lodash/debounce'
export default {
state: {
@@ -24,7 +24,7 @@ export default {
commit('alertChange', opts)
dispatch('alertDismiss')
},
alertDismiss: _.debounce(({ commit }) => {
alertDismiss: debounce(({ commit }) => {
let opts = { shown: false }
commit('alertChange', opts)
}, 3000)

View File

@@ -0,0 +1,16 @@
'use strict'
export default {
namespaced: true,
state: {
shown: false
},
getters: {},
mutations: {
shownChange: (state, shownState) => { state.shown = shownState }
},
actions: {
open({ commit }) { commit('shownChange', true) },
close({ commit }) { commit('shownChange', false) }
}
}