visuddhinanda 2 jaren geleden
bovenliggende
commit
d1015d7659
1 gewijzigde bestanden met toevoegingen van 35 en 0 verwijderingen
  1. 35 0
      dashboard/src/reducers/wbw.ts

+ 35 - 0
dashboard/src/reducers/wbw.ts

@@ -0,0 +1,35 @@
+/**
+ * 查字典,添加术语命令
+ */
+import { createSlice, PayloadAction } from "@reduxjs/toolkit";
+
+import type { RootState } from "../store";
+
+export interface ITermCommand {}
+
+export interface IShowWbw {
+  id?: string;
+  channel?: string;
+}
+
+interface IState {
+  anchor?: IShowWbw;
+}
+
+const initialState: IState = {};
+
+export const slice = createSlice({
+  name: "wbw",
+  initialState,
+  reducers: {
+    showWbw: (state, action: PayloadAction<IShowWbw>) => {
+      state.anchor = action.payload;
+    },
+  },
+});
+
+export const { showWbw } = slice.actions;
+
+export const anchor = (state: RootState): IShowWbw | undefined =>
+  state.wbw.anchor;
+export default slice.reducer;