Redux initial setup

This commit is contained in:
Sofiya Tepikin
2019-07-31 13:39:49 +02:00
parent 2d1ab273a0
commit 216a9044cd
4 changed files with 163 additions and 9 deletions
+18
View File
@@ -0,0 +1,18 @@
import { createSlice } from 'redux-starter-kit'
const dateSlice = createSlice({
slice: 'date',
initialState: null,
reducers: {
setDate: (state, action) => action.payload
}
})
// Extract the action creators object and the reducer
const { actions, reducer, selectors } = dateSlice
// Extract and export each action creator by name
export const { setDate } = actions
export const { getDate } = selectors
export default reducer