MCPcopy Index your code
hub / github.com/tinyplex/tinybase / useUndoInformation

Function useUndoInformation

src/ui-react/hooks.ts:2254–2268  ·  view source on GitHub ↗
(
  checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
)

Source from the content-addressed store, hash-verified

2252};
2253
2254export const useUndoInformation: typeof useUndoInformationDecl = (
2255 checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
2256): UndoOrRedoInformation => {
2257 const checkpoints = useCheckpointsOrCheckpointsById(
2258 checkpointsOrCheckpointsId,
2259 );
2260 const [backwardIds, currentId] = useCheckpointIds(checkpoints);
2261 return [
2262 !arrayIsEmpty(backwardIds),
2263 useGoBackwardCallback(checkpoints),
2264 currentId,
2265 ifNotUndefined(currentId, (id) => checkpoints?.getCheckpoint(id)) ??
2266 EMPTY_STRING,
2267 ];
2268};
2269
2270export const useRedoInformation: typeof useRedoInformationDecl = (
2271 checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,

Callers 2

CheckpointInfoFunction · 0.90
TestFunction · 0.90

Calls 5

useCheckpointIdsFunction · 0.90
arrayIsEmptyFunction · 0.90
useGoBackwardCallbackFunction · 0.90
getCheckpointMethod · 0.65

Tested by 2

CheckpointInfoFunction · 0.72
TestFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…