(groupPath: Path)
| 153 | } |
| 154 | |
| 155 | function 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 |
no test coverage detected