TinyBase logoTinyBase


The getListenerStats method provides a set of statistics about the listeners registered with the Relationships object, and is used for debugging purposes.

getListenerStats(): RelationshipsListenerStats

A RelationshipsListenerStats object containing Relationships listener statistics.

The RelationshipsListenerStats object contains a breakdown of the different types of listener.

The statistics are only populated in a debug build: production builds return an empty object. The method is intended to be used during development to ensure your application is not leaking listener registrations, for example.


This example gets the listener statistics of a Relationships object.

const store = createStore();
const relationships = createRelationships(store);
relationships.addRemoteRowIdListener(null, null, () => {
  console.log('Remote Row Id changed');
relationships.addLocalRowIdsListener(null, null, () => {
  console.log('Local Row Id changed');

const listenerStats = relationships.getListenerStats();
// -> 1
// -> 1