TinyBase logoTinyBase β

useCheckpoint

The useCheckpoint hook returns a reactive object reflecting the label of a checkpoint, and registers a listener so that any changes will update .current.

useCheckpoint(
  checkpointId: MaybeGetter<string>,
  checkpointsOrCheckpointsId?: MaybeGetter<undefined | CheckpointsOrCheckpointsId>,
): {current: string | undefined}
TypeDescription
checkpointIdMaybeGetter<string>

The Id of the checkpoint (or a getter returning it).

checkpointsOrCheckpointsId?MaybeGetter<undefined | CheckpointsOrCheckpointsId>

The Checkpoints object to use (plain or getter), or its Id.

returns{current: string | undefined}

A reactive object with a current string | undefined property.

Since

v8.1.0