Comparing version 2.4.6 to 2.4.7
@@ -109,4 +109,3 @@ "use strict"; | ||
name: actionName, | ||
changeList: [], | ||
childs: [] | ||
changeList: [] | ||
}; | ||
@@ -120,5 +119,8 @@ global_state_1.globalState.debugOutputActionMapBatchDeep.set(global_state_1.globalState.batchDeep, debugOutputBundleAction); | ||
} | ||
// 如果当前深度大于 1,就作为加到父级的 childs | ||
// 如果当前深度大于 1,就作为加到父级的 changeList | ||
if (global_state_1.globalState.batchDeep > 1) { | ||
global_state_1.globalState.debugOutputActionMapBatchDeep.get(global_state_1.globalState.batchDeep - 1).childs.push(debugOutputBundleAction); | ||
global_state_1.globalState.debugOutputActionMapBatchDeep.get(global_state_1.globalState.batchDeep - 1).changeList.push({ | ||
type: "action", | ||
action: debugOutputBundleAction | ||
}); | ||
} | ||
@@ -131,2 +133,4 @@ } | ||
function debugOutAction() { | ||
// 每次出栈,都要更新 currentDebugOutputAction | ||
global_state_1.globalState.currentDebugOutputAction = global_state_1.globalState.debugOutputActionMapBatchDeep.get(global_state_1.globalState.batchDeep); | ||
if (!inAction()) { | ||
@@ -133,0 +137,0 @@ // 如果完全出队列了,把存储的 debug 信息输出给 debug 事件,并清空 debug 信息 |
{ | ||
"name": "dob", | ||
"version": "2.4.6", | ||
"version": "2.4.7", | ||
"description": "", | ||
@@ -66,3 +66,3 @@ "main": "built/src/index.js", | ||
"entrys": [ | ||
"demos/reaction/index.ts" | ||
"demos/debug/index.ts" | ||
], | ||
@@ -69,0 +69,0 @@ "rules": [ |
@@ -141,2 +141,6 @@ # Dob · [](https://travis-ci.org/ascoders/dob) [](https://www.npmjs.com/package/dob) [](https://codecov.io/github/ascoders/dob) | ||
type: string | ||
/** | ||
* called child action in this action, when type is action | ||
*/ | ||
action?: IDebugInfo | ||
callStack: PropertyKey[] | ||
@@ -149,11 +153,7 @@ oldValue?: any | ||
/** | ||
* used when type is delete | ||
* operate key | ||
*/ | ||
deleteKey?: PropertyKey | ||
key?: PropertyKey | ||
customMessage?: any[] | ||
}> | ||
/** | ||
* child actions | ||
*/ | ||
childs?: IDebugInfo[] | ||
} | ||
@@ -160,0 +160,0 @@ ``` |
@@ -29,5 +29,9 @@ import { Event } from "./event" | ||
/** | ||
* 调用的 action,仅 type 为 action 时 | ||
*/ | ||
action?: IDebugInfo | ||
/** | ||
* 调用栈 | ||
*/ | ||
callStack: PropertyKey[] | ||
callStack?: PropertyKey[] | ||
/** | ||
@@ -50,6 +54,2 @@ * 旧值 | ||
}> | ||
/** | ||
* 子 action | ||
*/ | ||
childs?: IDebugInfo[] | ||
} | ||
@@ -56,0 +56,0 @@ |
@@ -126,4 +126,3 @@ import { globalState, IDebugInfo } from "./global-state" | ||
name: actionName, | ||
changeList: [], | ||
childs: [] | ||
changeList: [] | ||
} | ||
@@ -140,5 +139,8 @@ | ||
// 如果当前深度大于 1,就作为加到父级的 childs | ||
// 如果当前深度大于 1,就作为加到父级的 changeList | ||
if (globalState.batchDeep > 1) { | ||
globalState.debugOutputActionMapBatchDeep.get(globalState.batchDeep - 1).childs.push(debugOutputBundleAction) | ||
globalState.debugOutputActionMapBatchDeep.get(globalState.batchDeep - 1).changeList.push({ | ||
type: "action", | ||
action: debugOutputBundleAction | ||
}) | ||
} | ||
@@ -151,2 +153,5 @@ } | ||
export function debugOutAction() { | ||
// 每次出栈,都要更新 currentDebugOutputAction | ||
globalState.currentDebugOutputAction = globalState.debugOutputActionMapBatchDeep.get(globalState.batchDeep) | ||
if (!inAction()) { | ||
@@ -153,0 +158,0 @@ // 如果完全出队列了,把存储的 debug 信息输出给 debug 事件,并清空 debug 信息 |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
500513
121
6133