Move files to lib folder
This commit is contained in:
parent
d8d8ac35f8
commit
cec664c8d0
26 changed files with 58 additions and 59 deletions
43
lib/store/dataStore.tsx
Normal file
43
lib/store/dataStore.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
// dataStore.js
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const dataStore = createSlice( {
|
||||
name: 'data',
|
||||
initialState: {
|
||||
session: {
|
||||
token: '',
|
||||
name: '',
|
||||
device: '',
|
||||
address: {
|
||||
id: 0,
|
||||
zipcode: '',
|
||||
houseNumber: '',
|
||||
street: '',
|
||||
city: '',
|
||||
},
|
||||
coordinates: {
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
},
|
||||
},
|
||||
reloadCalendar: true,
|
||||
viewCategory: null,
|
||||
},
|
||||
reducers: {
|
||||
setSession: (state, action) => {
|
||||
state.session = action.payload;
|
||||
},
|
||||
setReloadCalendar: (state, action) => {
|
||||
state.reloadCalendar = action.payload;
|
||||
},
|
||||
setViewCategory: (state, action) => {
|
||||
state.viewCategory = action.payload;
|
||||
},
|
||||
},
|
||||
} );
|
||||
|
||||
export const { setSession } = dataStore.actions;
|
||||
export const { setReloadCalendar } = dataStore.actions;
|
||||
export const { setViewCategory } = dataStore.actions;
|
||||
|
||||
export default dataStore.reducer;
|
Loading…
Add table
Add a link
Reference in a new issue