TinyBase logoTinyBase β

useCheckpointListener

The useCheckpointListener hook registers a listener that is called whenever the label of a specified Checkpoint changes.

useCheckpointListener(
  checkpointId: MaybeGetter<IdOrNull>,
  listener: CheckpointListener,
  checkpointsOrCheckpointsId?: MaybeGetter<undefined | CheckpointsOrCheckpointsId>,
): void
TypeDescription
checkpointIdMaybeGetter<IdOrNull>

The Id of the Checkpoint to listen to, or null to listen to any Checkpoint.

listenerCheckpointListener

The function to call when the Checkpoint label changes.

checkpointsOrCheckpointsId?MaybeGetter<undefined | CheckpointsOrCheckpointsId>

The Checkpoints object to use, or its Id.

returnsvoid

This has no return value.

Since

v8.1.0