TinyBase logoTinyBase

hasValue

The hasValue method returns a boolean indicating whether a given Value exists in the Store.

hasValue(valueId: string): boolean
TypeDescription
valueIdstring

The Id of a possible Value in the Store.

returnsboolean

Whether a Value with that Id exists in the Store.

Example

This example shows two simple Value existence checks.

import {createStore} from 'tinybase';

const store = createStore().setValues({open: true});
console.log(store.hasValue('open'));
// -> true
console.log(store.hasValue('employees'));
// -> false

Since

v3.0.0