Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CollectionReference } from '@firebase/firestore-types';
import { CollectionReference, QuerySnapshot } from '@firebase/firestore-types';
import { Injectable } from '@angular/core';

import { BehaviorSubject } from 'rxjs';
import { filter } from 'rxjs/operators';
import * as _ from 'lodash';

import { AngularFirestore, AngularFirestoreCollection, DocumentData, QuerySnapshot } from '@angular/fire/firestore';
import { AngularFirestore, AngularFirestoreCollection, DocumentData } from '@angular/fire/firestore';
import { IObject } from '@iote/bricks';
import { __DateFromStorage } from '@ngfire/time';

Expand Down Expand Up @@ -71,14 +71,14 @@ export class PaginatedScroll<T extends IObject>
return this.docs$$.asObservable().pipe(filter(o => o != null));
}

more() : void
more(newPageSize?: number) : void
{
const collection = this._getMessageCollection();

// 1. Configure next query behaviour
const docs$ = collection.orderBy(this._opts.orderByField, this._opts.reverse ? 'desc' : 'asc')
.startAt(this.start)
.limit(this._opts.limit).get();
.limit(newPageSize ?? this._opts.limit).get();

// 2. Get the next snapshot. Will only fire once on get!
docs$.then((snapshots) => {
Expand Down