Files
drip/slices/date.js
T
2022-07-29 08:57:19 +00:00

20 lines
506 B
JavaScript

import { createSlice } from 'redux-starter-kit'
import { LocalDate } from '@js-joda/core'
const dateSlice = createSlice({
slice: 'date',
initialState: LocalDate.now().toString(),
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