diff --git a/src/store/cache/actions.ts b/src/store/cache/actions.ts new file mode 100644 index 0000000..8042ef0 --- /dev/null +++ b/src/store/cache/actions.ts @@ -0,0 +1,11 @@ +import { ActionTree } from 'vuex'; +import { StateInterface } from '../index'; +import { ExampleStateInterface } from './state'; + +const actions: ActionTree = { + someAction (/* context */) { + // your code + } +}; + +export default actions; diff --git a/src/store/cache/getters.ts b/src/store/cache/getters.ts new file mode 100644 index 0000000..96d6454 --- /dev/null +++ b/src/store/cache/getters.ts @@ -0,0 +1,11 @@ +import { GetterTree } from 'vuex'; +import { StateInterface } from '../index'; +import { ExampleStateInterface } from './state'; + +const getters: GetterTree = { + someGetter (/* context */) { + // your code + } +}; + +export default getters; diff --git a/src/store/cache/index.ts b/src/store/cache/index.ts new file mode 100644 index 0000000..fee2203 --- /dev/null +++ b/src/store/cache/index.ts @@ -0,0 +1,16 @@ +import { Module } from 'vuex'; +import { StateInterface } from '../index'; +import state, { ExampleStateInterface } from './state'; +import actions from './actions'; +import getters from './getters'; +import mutations from './mutations'; + +const exampleModule: Module = { + namespaced: true, + actions, + getters, + mutations, + state +}; + +export default exampleModule; diff --git a/src/store/cache/mutations.ts b/src/store/cache/mutations.ts new file mode 100644 index 0000000..70d45da --- /dev/null +++ b/src/store/cache/mutations.ts @@ -0,0 +1,10 @@ +import { MutationTree } from 'vuex'; +import { ExampleStateInterface } from './state'; + +const mutation: MutationTree = { + someMutation (/* state: ExampleStateInterface */) { + // your code + } +}; + +export default mutation; diff --git a/src/store/cache/state.ts b/src/store/cache/state.ts new file mode 100644 index 0000000..4326992 --- /dev/null +++ b/src/store/cache/state.ts @@ -0,0 +1,11 @@ +export interface ExampleStateInterface { + prop: boolean; +} + +function state(): ExampleStateInterface { + return { + prop: false, + }; +} + +export default state;