MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / expandNode

Function expandNode

app/hooks/useVirtualTree.ts:121–136  ·  view source on GitHub ↗
(
  state: TreeState<T>,
  id: string
)

Source from the content-addressed store, hash-verified

119 | CollapseAllNodesAction;
120
121function expandNode<T extends { id: string; children?: T[] }>(
122 state: TreeState<T>,
123 id: string
124): TreeState<T> {
125 const collapsedState = {
126 ...state.collapsedState,
127 [id]: false,
128 };
129
130 return {
131 ...state,
132 collapsedState,
133 items: createNodeItems(state.nodes, 0, collapsedState),
134 focusedNodeId: id,
135 };
136}
137
138function collapseNode<T extends { id: string; children?: T[] }>(
139 state: TreeState<T>,

Callers 1

useVirtualTreeFunction · 0.85

Calls 1

createNodeItemsFunction · 0.85

Tested by

no test coverage detected