getValue
Essential
The getValue method returns a single keyed Value in the Store.
getValue(valueId: string): ValueOrUndefined| Type | Description | |
|---|---|---|
valueId | string | |
| returns | ValueOrUndefined | The |
Examples
This example retrieves a single Value.
import {createStore} from 'tinybase';
const store = createStore().setValues({open: true, employees: 3});
console.log(store.getValue('employees'));
// -> 3
This example retrieves a Value that does not exist, returning undefined.
import {createStore} from 'tinybase';
const store = createStore().setValues({open: true, employees: 3});
console.log(store.getValue('website'));
// -> undefined
Since
v3.0.0