12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import { INIT_PAYMENTS_CURRENCIES } from '@/constants/actionTypes'
- import { SET_CURRENCIES, SET_LOADING_CURRENCIES } from '@/constants/mutationTypes'
- const initialState = {
- currency: null,
- loadingCurrency: false
- }
- const state = {
- currency: initialState.currency,
- loadingCurrency: initialState.loadingCurrency
- }
- const getters = {
- /**
- * [currency]
- * @param {[type]} state [description]
- * @return {[type]} [description]
- */
- currency(state) {
- return state.currency
- },
- /**
- * [loadingCurrency]
- * @param {[type]} state [description]
- * @return {[type]} [description]
- */
- loadingCurrency(state) {
- return state.loadingCurrency
- }
- }
- const mutations = {
- /**
- * [currency]
- * @param {[type]} state [description]
- * @param {[type]} payload [description]
- */
- [SET_CURRENCIES] (state, payload) {
- state.currency = payload
- },
- /**
- * [loadingCurrency]
- * @param {[type]} state [description]
- * @param {[type]} payload [description]
- */
- [SET_LOADING_CURRENCIES] (state, payload) {
- state.loadingCurrency = !!payload
- }
- }
- const actions = {
- /**
- * [INIT_CURRENCIES]
- * @param {*} param0
- * @param {*} payload
- */
- [INIT_PAYMENTS_CURRENCIES] ({commit}, payload) {
- commit(SET_CURRENCIES, payload)
- commit(SET_LOADING_CURRENCIES, payload)
- }
- }
- export default {
- state,
- getters,
- mutations,
- actions
- }
|