mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
27 lines
568 B
TypeScript
27 lines
568 B
TypeScript
import store from "../store";
|
|
import { setEditMemoId, setMarkMemoId } from "../store/modules/editor";
|
|
|
|
const editorStateService = {
|
|
getState: () => {
|
|
return store.getState().editor;
|
|
},
|
|
|
|
setEditMemoWithId: (editMemoId: MemoId) => {
|
|
store.dispatch(setEditMemoId(editMemoId));
|
|
},
|
|
|
|
clearEditMemo: () => {
|
|
store.dispatch(setEditMemoId());
|
|
},
|
|
|
|
setMarkMemoWithId: (markMemoId: MemoId) => {
|
|
store.dispatch(setMarkMemoId(markMemoId));
|
|
},
|
|
|
|
clearMarkMemo: () => {
|
|
store.dispatch(setMarkMemoId());
|
|
},
|
|
};
|
|
|
|
export default editorStateService;
|