Fixing UI for 2.1 data changes
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
export default function walkDown(tree, callback){
|
||||
let stack = [...tree];
|
||||
while(stack.length){
|
||||
let node = stack.pop();
|
||||
callback(node, stack);
|
||||
stack.push(...node.children);
|
||||
}
|
||||
}
|
||||
14
app/imports/api/engine/computation/utility/walkdown.ts
Normal file
14
app/imports/api/engine/computation/utility/walkdown.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { TreeDoc } from '/imports/api/parenting/ChildSchema';
|
||||
import { TreeNode } from '/imports/api/parenting/parentingFunctions';
|
||||
|
||||
export default function walkDown<T extends TreeDoc>(
|
||||
trees: TreeNode<T>[], callback: (node: TreeNode<T>, stack: TreeNode<T>[]) => any
|
||||
) {
|
||||
const stack = [...trees];
|
||||
while (stack.length) {
|
||||
const node = stack.pop();
|
||||
if (!node) return;
|
||||
callback(node, stack);
|
||||
stack.push(...node.children);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user