Skip to content

Commit

Permalink
feat: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
nuintun committed May 19, 2024
1 parent 36fe8df commit 396fc44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export class Tree<T> {
/**
* @method dfs
* @description The dfs traversal iterator.
* @param backtrace Backtracking callback function.
* @param onInternalDone Internal node traversal done event.
*/
public *dfs(backtrace?: () => void): Iterable<IteratorValue<T>> {
public *dfs(onInternalDone?: () => void): Iterable<IteratorValue<T>> {
const { roots, resolve } = this;
const waiting: Waiting<T>[] = [];

Expand All @@ -44,7 +44,7 @@ export class Tree<T> {
if (item.done) {
current = waiting.pop();

backtrace && backtrace();
onInternalDone && onInternalDone();
} else {
const [index, node] = item.value;
const children = resolve(node, index);
Expand Down

0 comments on commit 396fc44

Please sign in to comment.