blob: ff38e0958fab83543c821ac2565062376b84f394 (
plain) (
blame)
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
|
const getDefaultState = () => ({
text: null,
error: false,
});
export const state = getDefaultState;
export const actions = {
set({ commit }, data) {
commit('set', data);
},
clear({ commit }) {
commit('clear');
},
};
export const mutations = {
set(state, { text, error }) {
state.text = text;
state.error = error;
},
clear(state) {
Object.assign(state, getDefaultState());
},
};
|