getChannelName
The getChannelName method returns the name of the channel being used for synchronization.
getChannelName(): string| returns | string | 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 {createMergeableStore} from 'tinybase';
import {createBroadcastChannelSynchronizer} from 'tinybase/synchronizers/synchronizer-broadcast-channel';
const store = createMergeableStore();
const synchronizer = createBroadcastChannelSynchronizer(store, 'channelA');
console.log(synchronizer.getChannelName());
// -> 'channelA'
await synchronizer.destroy();
Since
v5.0.0