MCPcopy Create free account
hub / github.com/adobe/react-spectrum / addNode

Function addNode

packages/react-stately/src/data/useTreeData.ts:259–266  ·  view source on GitHub ↗
(node: TreeNode<T>, map: Map<Key, TreeNode<T>>)

Source from the content-addressed store, hash-verified

257 }
258
259 function addNode(node: TreeNode<T>, map: Map<Key, TreeNode<T>>) {
260 map.set(node.key, node);
261 if (node.children) {
262 for (let child of node.children) {
263 addNode(child, map);
264 }
265 }
266 }
267
268 function deleteNode(node: TreeNode<T>, map: Map<Key, TreeNode<T>>) {
269 map.delete(node.key);

Callers 4

updateMethod · 0.85
updateTreeFunction · 0.85
moveFunction · 0.85
moveItemsFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected