feat: 添加文件菜单

This commit is contained in:
2021-10-06 16:06:08 +08:00
parent 65a63081fc
commit 267fb2a023
8 changed files with 950 additions and 225 deletions
+7
View File
@@ -52,6 +52,11 @@ function go(span) {
Object.assign(globalStore, storeHistory[newCursor]);
}
function clearHistory() {
storeHistory.length = 0;
cursor = -1;
}
// 包装mobx的action以实现历史记录
function executeAction(actionFunc, ...args) {
actionFunc.apply(this, args);
@@ -88,12 +93,14 @@ function runInWrappedAction(func) {
executeAction.call(this, func);
});
}
// 不需要记录历史记录的时候直接使用原action
const unwrappedAction = action;
const runInUnwrappedAction = runInAction;
export {
go,
clearHistory,
wrappedAction,
runInWrappedAction,
unwrappedAction,