MCPcopy Create free account
hub / github.com/bytebase/bytebase / useImmutableUpdate

Function useImmutableUpdate

frontend/src/react/components/ExprEditor.tsx:155–169  ·  view source on GitHub ↗
(groupPath: Path)

Source from the content-addressed store, hash-verified

153}
154
155function useImmutableUpdate(groupPath: Path) {
156 const { root, onUpdate } = useExprEditorCtx();
157
158 return useCallback(
159 (mutate: (group: ConditionGroupExpr) => void) => {
160 onUpdate(
161 updateExpr(root, (clone) => {
162 const group = getGroupAtPath(clone, groupPath);
163 mutate(group);
164 })
165 );
166 },
167 [root, onUpdate, groupPath]
168 );
169}
170
171// ============================================================
172// PortaledDropdown

Callers 6

FactorSelectFunction · 0.85
OperatorSelectFunction · 0.85
ValueInputFunction · 0.85
ConditionRowFunction · 0.85
RawStringEditorFunction · 0.85
ConditionGroupFunction · 0.85

Calls 3

useExprEditorCtxFunction · 0.85
updateExprFunction · 0.85
getGroupAtPathFunction · 0.85

Tested by

no test coverage detected