Commit 346699eb authored by Chunchi Che's avatar Chunchi Che

update moraSlice.ts

parent 6e57d067
Pipeline #20467 passed with stages
in 6 minutes and 50 seconds
...@@ -6,11 +6,13 @@ import { createSlice } from "@reduxjs/toolkit"; ...@@ -6,11 +6,13 @@ import { createSlice } from "@reduxjs/toolkit";
import { RootState } from "../store"; import { RootState } from "../store";
export interface moraState { export interface moraState {
duelStart: boolean;
selectHandAble: boolean; selectHandAble: boolean;
selectTpAble: boolean; selectTpAble: boolean;
} }
const initialState: moraState = { const initialState: moraState = {
duelStart: false,
selectHandAble: false, selectHandAble: false,
selectTpAble: false, selectTpAble: false,
}; };
...@@ -19,6 +21,9 @@ const moraSlice = createSlice({ ...@@ -19,6 +21,9 @@ const moraSlice = createSlice({
name: "mora", name: "mora",
initialState, initialState,
reducers: { reducers: {
duelStart: (state) => {
state.duelStart = true;
},
selectHandAble: (state) => { selectHandAble: (state) => {
state.selectHandAble = true; state.selectHandAble = true;
}, },
...@@ -35,11 +40,13 @@ const moraSlice = createSlice({ ...@@ -35,11 +40,13 @@ const moraSlice = createSlice({
}); });
export const { export const {
duelStart,
selectHandAble, selectHandAble,
unSelectHandAble, unSelectHandAble,
selectTpAble, selectTpAble,
unSelectTpAble, unSelectTpAble,
} = moraSlice.actions; } = moraSlice.actions;
export const selectDuelStart = (state: RootState) => state.mora.duelStart;
export const selectHandSelectAble = (state: RootState) => export const selectHandSelectAble = (state: RootState) =>
state.mora.selectHandAble; state.mora.selectHandAble;
export const selectTpSelectAble = (state: RootState) => state.mora.selectTpAble; export const selectTpSelectAble = (state: RootState) => state.mora.selectTpAble;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment