refactor: use redux

This commit is contained in:
boojack
2022-05-21 12:21:06 +08:00
parent 2e9152e223
commit c2e5a1a524
45 changed files with 674 additions and 1101 deletions

View File

@ -0,0 +1,18 @@
import store from "../store";
import { setEditMemoId, setMarkMemoId } from "../store/modules/editor";
const editorStateService = {
getState: () => {
return store.getState().editor;
},
setEditMemo: (editMemoId: MemoId) => {
store.dispatch(setEditMemoId(editMemoId));
},
setMarkMemo: (markMemoId: MemoId) => {
store.dispatch(setMarkMemoId(markMemoId));
},
};
export default editorStateService;