MCPcopy Create free account
hub / github.com/tinyplex/tinybase / useGoToCallback

Function useGoToCallback

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:1191–1206  ·  view source on GitHub ↗
(getCheckpointId, getCheckpointIdDeps = EMPTY_ARRAY, checkpointsOrCheckpointsId, then = getUndefined, thenDeps = EMPTY_ARRAY)

Source from the content-addressed store, hash-verified

1189var useGoBackwardCallback = (checkpointsOrCheckpointsId) => useCheckpointAction(checkpointsOrCheckpointsId, "goBackward");
1190var useGoForwardCallback = (checkpointsOrCheckpointsId) => useCheckpointAction(checkpointsOrCheckpointsId, "goForward");
1191var useGoToCallback = (getCheckpointId, getCheckpointIdDeps = EMPTY_ARRAY, checkpointsOrCheckpointsId, then = getUndefined, thenDeps = EMPTY_ARRAY) => {
1192 const checkpoints = useCheckpointsOrCheckpointsById(
1193 checkpointsOrCheckpointsId
1194 );
1195 return useCallback(
1196 (parameter) => ifNotUndefined(
1197 checkpoints,
1198 (checkpoints2) => ifNotUndefined(
1199 getCheckpointId(parameter),
1200 (checkpointId) => then(checkpoints2.goTo(checkpointId), checkpointId)
1201 )
1202 ),
1203 // eslint-disable-next-line react-hooks/exhaustive-deps
1204 [checkpoints, ...getCheckpointIdDeps, ...thenDeps]
1205 );
1206};
1207var useUndoInformation = (checkpointsOrCheckpointsId) => {
1208 const checkpoints = useCheckpointsOrCheckpointsById(
1209 checkpointsOrCheckpointsId

Callers

nothing calls this directly

Calls 2

goToMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…