getMergeableContentHashes
The getMergeableContentHashes
method returns hashes for the full content of a MergeableStore
.
getMergeableContentHashes(): ContentHashes
returns | ContentHashes | A |
---|
If two MergeableStore
instances have different hashes, that indicates that the mergeable Tables
or Values
within them are different and should be synchronized.
The method is generally intended to be used internally within TinyBase itself and the return type is assumed to be opaque to applications that use it.
Example
This example creates a MergeableStore
, sets some data, and then accesses the content hashes.
import {createMergeableStore} from 'tinybase';
const store = createMergeableStore('store1');
store.setCell('pets', 'fido', 'color', 'brown');
console.log(store.getMergeableContentHashes());
// -> [784336119, 0]
store.setValue('open', true);
console.log(store.getMergeableContentHashes());
// -> [784336119, 2829789038]
Since
v5.0.0