diff --git a/src/Tree.ts b/src/Tree.ts index aa0fcda..71e7afb 100644 --- a/src/Tree.ts +++ b/src/Tree.ts @@ -30,9 +30,9 @@ export class Tree { /** * @method dfs * @description The dfs traversal iterator. - * @param backtrace Backtracking callback function. + * @param onInternalDone Internal node traversal done event. */ - public *dfs(backtrace?: () => void): Iterable> { + public *dfs(onInternalDone?: () => void): Iterable> { const { roots, resolve } = this; const waiting: Waiting[] = []; @@ -44,7 +44,7 @@ export class Tree { if (item.done) { current = waiting.pop(); - backtrace && backtrace(); + onInternalDone && onInternalDone(); } else { const [index, node] = item.value; const children = resolve(node, index);