MCPcopy
hub / github.com/tinyplex/tinybase / useUndoInformation

Function useUndoInformation

docs/pseudo.esm.sh/tinybase@9.0.0/ui-react/index.js:1207–1218  ·  view source on GitHub ↗
(checkpointsOrCheckpointsId)

Source from the content-addressed store, hash-verified

1205 );
1206};
1207var useUndoInformation = (checkpointsOrCheckpointsId) => {
1208 const checkpoints = useCheckpointsOrCheckpointsById(
1209 checkpointsOrCheckpointsId
1210 );
1211 const [backwardIds, currentId] = useCheckpointIds(checkpoints);
1212 return [
1213 !arrayIsEmpty(backwardIds),
1214 useGoBackwardCallback(checkpoints),
1215 currentId,
1216 ifNotUndefined(currentId, (id) => checkpoints?.getCheckpoint(id)) ?? EMPTY_STRING
1217 ];
1218};
1219var useRedoInformation = (checkpointsOrCheckpointsId) => {
1220 const checkpoints = useCheckpointsOrCheckpointsById(
1221 checkpointsOrCheckpointsId

Callers

nothing calls this directly

Calls 5

useCheckpointIdsFunction · 0.70
arrayIsEmptyFunction · 0.70
useGoBackwardCallbackFunction · 0.70
getCheckpointMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…