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

Function moveToChildren

app/useColumnView/index.ts:455–475  ·  view source on GitHub ↗
(state: ColumnViewState)

Source from the content-addressed store, hash-verified

453}
454
455function moveToChildren(state: ColumnViewState): ColumnViewState {
456 const { highlightedNodeId } = state;
457
458 if (!highlightedNodeId) {
459 return state;
460 }
461
462 const highlightedNode = state.nodeTable[highlightedNodeId];
463
464 if (!highlightedNode || highlightedNode.children.length === 0) {
465 return state;
466 }
467
468 const id = highlightedNode.children[0];
469
470 return {
471 ...state,
472 selectedNodeId: id,
473 highlightedNodeId: id,
474 };
475}
476
477// TODO: CACHE THIS
478function generateColumns(

Callers 1

columnViewReducerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected