( getCheckpointId: (parameter: Parameter) => Id, getCheckpointIdDeps: DependencyList = EMPTY_ARRAY, checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId, then: (checkpoints: Checkpoints, checkpointId: Id) => void = getUndefined, thenDeps: DependencyList = EMPTY_ARRAY, )
| 2230 | ): Callback => useCheckpointAction(checkpointsOrCheckpointsId, 'goForward'); |
| 2231 | |
| 2232 | export const useGoToCallback: typeof useGoToCallbackDecl = <Parameter>( |
| 2233 | getCheckpointId: (parameter: Parameter) => Id, |
| 2234 | getCheckpointIdDeps: DependencyList = EMPTY_ARRAY, |
| 2235 | checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId, |
| 2236 | then: (checkpoints: Checkpoints, checkpointId: Id) => void = getUndefined, |
| 2237 | thenDeps: DependencyList = EMPTY_ARRAY, |
| 2238 | ): ParameterizedCallback<Parameter> => { |
| 2239 | const checkpoints = useCheckpointsOrCheckpointsById( |
| 2240 | checkpointsOrCheckpointsId, |
| 2241 | ); |
| 2242 | return useCallback( |
| 2243 | (parameter) => |
| 2244 | ifNotUndefined(checkpoints, (checkpoints) => |
| 2245 | ifNotUndefined(getCheckpointId(parameter as any), (checkpointId: Id) => |
| 2246 | then(checkpoints.goTo(checkpointId), checkpointId), |
| 2247 | ), |
| 2248 | ), |
| 2249 | // eslint-disable-next-line react-hooks/exhaustive-deps |
| 2250 | [checkpoints, ...getCheckpointIdDeps, ...thenDeps], |
| 2251 | ); |
| 2252 | }; |
| 2253 | |
| 2254 | export const useUndoInformation: typeof useUndoInformationDecl = ( |
| 2255 | checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId, |
searching dependent graphs…