Files
drip/slices/navigation.js
T
2020-02-04 20:45:23 +01:00

25 lines
545 B
JavaScript

import { createSlice } from 'redux-starter-kit'
const navigationSlice = createSlice({
slice: 'navigation',
initialState: {
currentPage: 'Home',
},
reducers: {
navigate: (state, action) => {
return {
currentPage: action.payload,
}
}
}
})
// Extract the action creators object and the reducer
const { actions, reducer, selectors } = navigationSlice
// Extract and export each action creator by name
export const { navigate } = actions
export const { getNavigation } = selectors
export default reducer