You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: projects/stream-chat-angular/src/lib/channel.service.ts
+69-16Lines changed: 69 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ import {
34
34
DefaultStreamChatGenerics,
35
35
MessageInput,
36
36
MessageReactionType,
37
+
NextPageConfiguration,
37
38
StreamMessage,
38
39
}from'./types';
39
40
@@ -293,6 +294,10 @@ export class ChannelService<
293
294
beforeUpdateMessage?: (
294
295
message: StreamMessage<T>
295
296
)=>StreamMessage<T>|Promise<StreamMessage<T>>;
297
+
/**
298
+
* By default the SDK uses an offset based pagination, you can change/extend this by providing your own custom paginator method. It will be called with the result of the latest channel query.
* Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.
697
702
*/
698
703
asyncloadMoreChannels(){
699
-
this.options!.offset=this.channels.length!;
700
704
awaitthis.queryChannels(false);
701
705
}
702
706
@@ -1108,9 +1112,7 @@ export class ChannelService<
1108
1112
}
1109
1113
this.isStateRecoveryInProgress=true;
1110
1114
try{
1111
-
if(this.options){
1112
-
this.options.offset=0;
1113
-
}
1115
+
this.nextPageConfiguration=undefined;
1114
1116
// If channel list is not inited, we set the active channel
1115
1117
constshoulSetActiveChannel=
1116
1118
this.shouldSetActiveChannel&&
@@ -1378,6 +1380,20 @@ export class ChannelService<
0 commit comments