TinyBase logoTinyBase

hasCheckpoint

The hasCheckpoint method returns a boolean indicating whether a given Checkpoint exists in the Checkpoints object.

hasCheckpoint(checkpointId: Id): boolean
TypeDescription
checkpointIdId

The Id of a possible Checkpoint in the Checkpoints object.

returnsboolean

Whether a Checkpoint with that Id exists.

Example

This example shows two simple Checkpoint existence checks.

const store = createStore().setTables({pets: {fido: {sold: false}}});
const checkpoints = createCheckpoints(store);
console.log(checkpoints.hasCheckpoint('0'));
// -> true
console.log(checkpoints.hasCheckpoint('1'));
// -> false