hasCheckpoint
The hasCheckpoint method returns a boolean indicating whether a given Checkpoint exists in the Checkpoints object.
hasCheckpoint(checkpointId: string): boolean| Type | Description | |
|---|---|---|
checkpointId | string | The |
| returns | boolean | Whether a Checkpoint with that |
Example
This example shows two simple Checkpoint existence checks.
import {createCheckpoints, createStore} from 'tinybase';
const store = createStore().setTables({pets: {fido: {sold: false}}});
const checkpoints = createCheckpoints(store);
console.log(checkpoints.hasCheckpoint('0'));
// -> true
console.log(checkpoints.hasCheckpoint('1'));
// -> false
Since
v1.0.0