[js] Run prettier for the first time

This commit is contained in:
Chris Bianca
2018-01-25 18:25:39 +00:00
parent 8feffd85c5
commit fba6380729
124 changed files with 4343 additions and 2633 deletions

View File

@@ -7,10 +7,18 @@ import Query from './Query';
import { firestoreAutoId } from '../../utils';
import type Firestore from './';
import type { FirestoreQueryDirection, FirestoreQueryOperator } from '../../types';
import type {
FirestoreQueryDirection,
FirestoreQueryOperator,
} from '../../types';
import type FieldPath from './FieldPath';
import type Path from './Path';
import type { Observer, ObserverOnError, ObserverOnNext, QueryListenOptions } from './Query';
import type {
Observer,
ObserverOnError,
ObserverOnNext,
QueryListenOptions,
} from './Query';
import type QuerySnapshot from './QuerySnapshot';
/**
@@ -37,13 +45,14 @@ export default class CollectionReference {
get parent(): DocumentReference | null {
const parentPath = this._collectionPath.parent();
return parentPath ? new DocumentReference(this._firestore, parentPath) : null;
return parentPath
? new DocumentReference(this._firestore, parentPath)
: null;
}
add(data: Object): Promise<DocumentReference> {
const documentRef = this.doc();
return documentRef.set(data)
.then(() => Promise.resolve(documentRef));
return documentRef.set(data).then(() => Promise.resolve(documentRef));
}
doc(documentPath?: string): DocumentReference {
@@ -77,12 +86,19 @@ export default class CollectionReference {
onSnapshot(
optionsOrObserverOrOnNext: QueryListenOptions | Observer | ObserverOnNext,
observerOrOnNextOrOnError?: Observer | ObserverOnNext | ObserverOnError,
onError?: ObserverOnError,
onError?: ObserverOnError
): () => void {
return this._query.onSnapshot(optionsOrObserverOrOnNext, observerOrOnNextOrOnError, onError);
return this._query.onSnapshot(
optionsOrObserverOrOnNext,
observerOrOnNextOrOnError,
onError
);
}
orderBy(fieldPath: string | FieldPath, directionStr?: FirestoreQueryDirection): Query {
orderBy(
fieldPath: string | FieldPath,
directionStr?: FirestoreQueryDirection
): Query {
return this._query.orderBy(fieldPath, directionStr);
}