(
getCheckpoint: (parameter: Parameter) => string | undefined = getUndefined,
checkpointsOrCheckpointsId?: MaybeCheckpointsOrCheckpointsId,
then: (
checkpointId: MaybeAccessor<Id>,
checkpoints: Checkpoints,
label?: string,
) => void = getUndefined,
)
| 1819 | ); |
| 1820 | |
| 1821 | export const useSetCheckpointCallback = <Parameter>( |
| 1822 | getCheckpoint: (parameter: Parameter) => string | undefined = getUndefined, |
| 1823 | checkpointsOrCheckpointsId?: MaybeCheckpointsOrCheckpointsId, |
| 1824 | then: ( |
| 1825 | checkpointId: MaybeAccessor<Id>, |
| 1826 | checkpoints: Checkpoints, |
| 1827 | label?: string, |
| 1828 | ) => void = getUndefined, |
| 1829 | ): ParameterizedCallback<Parameter> => { |
| 1830 | const checkpoints = useCheckpointsOrCheckpointsById( |
| 1831 | checkpointsOrCheckpointsId, |
| 1832 | ); |
| 1833 | return (parameter) => |
| 1834 | ifNotUndefined(getThing(checkpoints), (resolvedCheckpoints) => { |
| 1835 | const label = getCheckpoint(parameter as Parameter); |
| 1836 | then( |
| 1837 | resolvedCheckpoints.addCheckpoint(label), |
| 1838 | resolvedCheckpoints, |
| 1839 | label, |
| 1840 | ); |
| 1841 | }); |
| 1842 | }; |
| 1843 | |
| 1844 | export const useGoBackwardCallback = ( |
| 1845 | checkpointsOrCheckpointsId?: MaybeCheckpointsOrCheckpointsId, |
searching dependent graphs…