TinyBase logoTinyBase β

getChannelName

The getChannelName method returns the name of the channel being used for synchronization.

getChannelName(): string
returnsstring

The channel name.

Example

This example creates a BroadcastChannelSynchronizer object for a newly-created MergeableStore and then gets the channel name back out again.

import {createBroadcastChannelSynchronizer} from 'tinybase/synchronizers/synchronizer-broadcast-channel';
import {createMergeableStore} from 'tinybase';

const store = createMergeableStore();
const synchronizer = createBroadcastChannelSynchronizer(store, 'channelA');

console.log(synchronizer.getChannelName());
// -> 'channelA'

synchronizer.destroy();

Since

v5.0.0