TinyBase logoTinyBase β

getMergeableContent

The getMergeableContent method returns the full content of a MergeableStore, together with the metadata required to make it mergeable with another.

getMergeableContent(): MergeableContent
returnsMergeableContent

A MergeableContent object for the full content of the MergeableStore.

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 and metadata required to make it mergeable.

import {createMergeableStore} from 'tinybase';

const store = createMergeableStore('store1');

store.setCell('pets', 'fido', 'color', 'brown');

console.log(store.getMergeableContent());
// ->
[
  [
    {
      pets: [
        {
          fido: [
            {color: ['brown', 'Nn1JUF-----FnHIC', 923684530]},
            '',
            851131566,
          ],
        },
        '',
        518810247,
      ],
    },
    '',
    784336119,
  ],
  [{}, '', 0],
];

Since

v5.0.0