Options
All
  • Public
  • Public/Protected
  • All
Menu

A paginated query for message history in a channel. Create via BaseChannel.createMessagesQuery.

example
const query = BaseChannel.createMessagesQuery({
channelIdentifier: new DirectChannelIdentifier('user-123'),
pageSize: 20,
});
while (query.hasNext) {
const result = await query.loadNextPage();
if (result.isOk) {
console.log('Messages:', result.data);
}
}

Hierarchy

Index

Accessors

  • get isLoading(): boolean
  • Whether the query is currently loading data

    Returns boolean

  • get hasNext(): boolean
  • Whether there are more pages of data to load

    Returns boolean

Methods

  • Loads the next page of query results. Returns a busy error if a load operation is already in progress.

    example
    const result = await query.loadNextPage();
    if (result.isOk) {
    console.log('Data:', result.data);
    }

    Returns Promise<NCResult<PageData<Message<any>>>>

    A promise resolving to the query result