Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(firestore): .get() Observable #1824

Merged
merged 3 commits into from
Aug 21, 2018
Merged
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
13 changes: 10 additions & 3 deletions src/firestore/collection/collection.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Observable, Subscriber } from 'rxjs';
import { Observable, from } from 'rxjs';
import { fromCollectionRef } from '../observable/fromRef';
import { map, filter, scan } from 'rxjs/operators';

import { Injectable } from '@angular/core';
import { firestore } from 'firebase/app';

import { DocumentChangeType, CollectionReference, Query, DocumentReference, DocumentData, QueryFn, AssociatedReference, DocumentChangeAction, DocumentChange } from '../interfaces';
import { docChanges, sortedChanges } from './changes';
Expand Down Expand Up @@ -113,6 +112,14 @@ export class AngularFirestoreCollection<T=DocumentData> {
);
}

/**
* Retrieve the results of the query once.
* @param options
*/
get(options: firestore.GetOptions) {
return from(this.query.get(options));
}

/**
* Add data to a collection reference.
*
Expand Down