21 lines
451 B
TypeScript
21 lines
451 B
TypeScript
import { createSlice } from '@reduxjs/toolkit'
|
|
import type { PayloadAction } from '@reduxjs/toolkit'
|
|
|
|
const birthdateSlice = createSlice({
|
|
name: 'birthdate',
|
|
initialState: '',
|
|
reducers: {
|
|
update(state, action: PayloadAction<string>) {
|
|
state = action.payload
|
|
return state
|
|
},
|
|
clear(state) {
|
|
state = ''
|
|
return state
|
|
},
|
|
},
|
|
})
|
|
|
|
export const { actions } = birthdateSlice
|
|
export default birthdateSlice.reducer
|