@sendbird/uikit-chat-hooks
Version:
A set of React hooks for integrating Sendbird chat functionality into your React app.
21 lines (18 loc) • 473 B
text/typescript
import type { CustomQueryInterface } from '../types';
type ConstructorParams<T> = {
next: () => Promise<T[]>;
isLoading: () => boolean;
hasNext: () => boolean;
};
export class CustomQuery<T> implements CustomQueryInterface<T> {
constructor(private params: ConstructorParams<T>) {}
get isLoading(): boolean {
return this.params.isLoading();
}
get hasNext(): boolean {
return this.params.hasNext();
}
next() {
return this.params.next();
}
}