junh_eee(이준희)
7 months ago
2 changed files with 50 additions and 0 deletions
@ -0,0 +1,48 @@ |
|||||||
|
import { createSlice } from '@reduxjs/toolkit'; |
||||||
|
|
||||||
|
const initCrtfyhp = { |
||||||
|
isRunning: false, |
||||||
|
isCrtfyhp: false, |
||||||
|
sendCount: 0, |
||||||
|
counter: { |
||||||
|
min: '03', |
||||||
|
sec: '00' |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
const crtfyhpSlice = createSlice({ |
||||||
|
name: 'crtfyhpSlice', |
||||||
|
initialState: initCrtfyhp, |
||||||
|
reducers: { |
||||||
|
isStartTimer: (state, action) => { |
||||||
|
state.isRunning = action.payload as boolean; |
||||||
|
}, |
||||||
|
isSendCrtfyhp: (state, action) => { |
||||||
|
state.isCrtfyhp = action.payload as boolean; |
||||||
|
}, |
||||||
|
setSendCount: (state, action) => { |
||||||
|
state.sendCount = state.sendCount + 1; |
||||||
|
}, |
||||||
|
setCounter: (state, action) => { |
||||||
|
state.counter = action.payload as { |
||||||
|
min: string; |
||||||
|
sec: string; |
||||||
|
}; |
||||||
|
}, |
||||||
|
resetTimer: (state, action) => { |
||||||
|
state.isRunning = false; |
||||||
|
state.isCrtfyhp = false; |
||||||
|
state.counter = { min: '03', sec: '00' }; |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
export const { |
||||||
|
isStartTimer, |
||||||
|
isSendCrtfyhp, |
||||||
|
setSendCount, |
||||||
|
setCounter, |
||||||
|
resetTimer |
||||||
|
} = crtfyhpSlice.actions; |
||||||
|
|
||||||
|
export const crtfyhpReducer = crtfyhpSlice.reducer; |
Loading…
Reference in new issue