Skip to content

Commit de93f26

Browse files
committed
docs(afs): add documentation to package
1 parent ad70a12 commit de93f26

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

docs/firestore/collections.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,16 @@ Imagine you're querying a list of T-Shirts. Every facet of the query should be p
190190
// You'll use an Observable source from a ReactiveForm control or even
191191
// an AngularFirestoreDocument
192192
const criteria$ = of({
193-
size: { op: '==', value: 'large' },
194-
price: { op: '>', value: 10 }
193+
size: 'large',
194+
price: 10
195195
});
196-
this.items = size$.switchMap(size => {
196+
this.items = criteria$.switchMap(criteria => {
197197
return this.afs
198-
.collection('tshirts', ref => ref.where('size', '==', size))
198+
.collection<Item>('tshirts', ref => {
199+
return ref
200+
.where('size', '==', criteria.size)
201+
.where('price', '>', criteria.price)
202+
})
199203
.snapshotChanges();
200204
});
201205
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.0.0-rc.0",
3+
"version": "5.0.0-rc.0-fs",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {

src/firestore/collection/changes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { fromCollectionRef } from '../observable/fromRef';
22
import { Query, DocumentChangeType, DocumentChange, DocumentSnapshot, QuerySnapshot } from 'firestore';
33
import { Observable } from 'rxjs/Observable';
4-
import 'rxjs/add/observable/map';
5-
import 'rxjs/add/observable/filter';
4+
import 'rxjs/add/operator/map';
5+
import 'rxjs/add/operator/filter';
66
import 'rxjs/add/operator/scan';
77

88
import { DocumentChangeAction, Action } from '../interfaces';

src/firestore/collection/collection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Subscriber } from 'rxjs/Subscriber';
66
import { fromCollectionRef } from '../observable/fromRef';
77
import 'rxjs/add/operator/map';
88
import 'rxjs/add/operator/filter';
9-
import 'rxjs/add/observable/do';
109

1110
import { Injectable } from '@angular/core';
1211
import { FirebaseApp } from 'angularfire2';

src/firestore/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "angularfire2/auth",
2+
"name": "angularfire2/firestore",
33
"version": "ANGULARFIRE2_VERSION",
4-
"description": "The auth module",
5-
"main": "../bundles/auth.umd.js",
4+
"description": "The firestore module",
5+
"main": "../bundles/firestore.umd.js",
66
"module": "index.js",
77
"es2015": "./es2015/index.js",
88
"keywords": [

tools/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ function copyReadme() {
218218
return copy(`${process.cwd()}/README.md`, `${process.cwd()}/dist/packages-dist/README.md`);
219219
}
220220

221+
function copyDocs() {
222+
return copy(`${process.cwd()}/docs`, `${process.cwd()}/dist/packages-dist/docs`);
223+
}
224+
221225
function measure(module) {
222226
const path = `${process.cwd()}/dist/packages-dist/bundles/${module}.umd.js`;
223227
const file = readFileSync(path);
@@ -286,6 +290,7 @@ function buildLibrary(globals) {
286290
.switchMap(() => Observable.from(createTestUmd(globals)))
287291
.switchMap(() => Observable.from(copyNpmIgnore()))
288292
.switchMap(() => Observable.from(copyReadme()))
293+
.switchMap(() => Observable.from(copyDocs()))
289294
.do(() => {
290295
const coreStats = measure('core');
291296
const authStats = measure('auth');

0 commit comments

Comments
 (0)