2017-09-22 02:19:46 +02:00
|
|
|
import constants from '@/constants';
|
2017-09-19 04:28:26 +02:00
|
|
|
import * as types from './mutations-types';
|
|
|
|
|
|
|
|
export const initialState = {
|
|
|
|
product: null,
|
|
|
|
isLoading: false,
|
2017-09-22 03:07:34 +02:00
|
|
|
ui: {
|
2017-09-22 02:19:46 +02:00
|
|
|
title: constants.APP_NAME,
|
|
|
|
backgroundColor: constants.APP_DEFAULT_BACKGROUND_COLOR,
|
|
|
|
},
|
2017-09-19 04:28:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export const mutations = {
|
|
|
|
[types.STORE_PRODUCT](state, { product }) {
|
|
|
|
state.product = product;
|
|
|
|
state.isLoading = false;
|
|
|
|
},
|
|
|
|
[types.IS_LOADING](state) {
|
|
|
|
state.isLoading = true;
|
|
|
|
},
|
2017-09-20 04:11:40 +02:00
|
|
|
[types.SET_TITLE](state, { title }) {
|
2017-09-22 03:07:34 +02:00
|
|
|
state.ui.title = title;
|
2017-09-22 02:19:46 +02:00
|
|
|
},
|
|
|
|
[types.SET_BACKGROUND_COLOR](state, { backgroundColor }) {
|
2017-09-22 03:07:34 +02:00
|
|
|
state.ui.backgroundColor = backgroundColor;
|
2017-09-20 04:11:40 +02:00
|
|
|
},
|
2017-09-19 04:28:26 +02:00
|
|
|
};
|