WIP: timer set
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { createSlice, type PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
interface StateType {
|
||||
startTime: string | null;
|
||||
}
|
||||
|
||||
const initialState: StateType = {
|
||||
startTime: null,
|
||||
};
|
||||
|
||||
const timeSlice = createSlice({
|
||||
name: "time",
|
||||
initialState,
|
||||
reducers: {
|
||||
setStartTime: (state, action: PayloadAction<string>) => {
|
||||
state.startTime = action.payload;
|
||||
},
|
||||
clearStartTime: (state) => {
|
||||
state.startTime = null;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setStartTime, clearStartTime } = timeSlice.actions;
|
||||
export default timeSlice.reducer;
|
||||
Reference in New Issue
Block a user