Blame view

api/dashboard/src/store/modules/ui.js 491 Bytes
0d8c0f816   Thanasis Naskos   initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  import * as types from '../mutation-types'
  
  // state
  export const state = {
    sidebarShow: true,
    sidebarMinimize: false
  }
  
  // getters
  export const getters = {
    sidebarShow: state => state.sidebarShow,
    sidebarMinimize: state => state.sidebarMinimize
  }
  
  // mutations
  export const mutations = {
    [types.TOGGLE] (state, variable) {
      state[variable] = !state[variable]
    }
  }
  
  // actions
  export const actions = {
    toggle ({ commit }, variable) {
      commit(types.TOGGLE, variable)
    }
  }