umami/redux/actions/app.js

19 lines
418 B
JavaScript
Raw Normal View History

2020-09-07 10:22:16 +02:00
import { createSlice } from '@reduxjs/toolkit';
import { getItem } from 'lib/web';
import { LOCALE_CONFIG } from 'lib/constants';
2020-09-07 10:22:16 +02:00
const app = createSlice({
name: 'app',
initialState: { locale: getItem(LOCALE_CONFIG) || 'en-US' },
2020-09-07 10:22:16 +02:00
reducers: {
updateApp(state, action) {
state = action.payload;
return state;
},
},
});
export const { updateApp } = app.actions;
export default app.reducer;