refactor progress

This commit is contained in:
Craig
2020-01-22 17:16:40 +00:00
parent d497806443
commit 8ba1b68a21
55 changed files with 4899 additions and 761 deletions

View File

@ -0,0 +1,30 @@
import { getterTree, mutationTree, actionTree } from 'typed-vuex'
import { accessor } from '~/store'
export const namespaced = true
export const state = () => ({
scroll: 10,
scroll_invert: true,
})
export const getters = getterTree(state, {})
export const mutations = mutationTree(state, {
setScroll(state, scroll: number) {
state.scroll = scroll
localStorage.setItem('scroll', `${scroll}`)
},
})
export const actions = actionTree(
{ state, getters, mutations },
{
initialise() {
const scroll = localStorage.getItem('scroll')
if (scroll) {
accessor.settings.setScroll(parseInt(scroll))
}
},
},
)