Skip to content

Commit

Permalink
update import syntax in readmes and messages (#3973)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feiyang1 authored Oct 21, 2020
1 parent 602ec18 commit 7c15fb0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages-exp/firebase-exp/compat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
Typescript:
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
`);

Expand Down
6 changes: 3 additions & 3 deletions packages/firebase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var app = firebase.initializeApp({ ... });
If you are using ES6 imports or TypeScript:

```js
import * as firebase from 'firebase';
import firebase from 'firebase';
var app = firebase.initializeApp({ ... });
```

Expand Down Expand Up @@ -147,7 +147,7 @@ services you use:

```js
// This import loads the firebase namespace along with all its type information.
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';

// These imports load individual services into the firebase namespace.
import 'firebase/auth';
Expand Down Expand Up @@ -187,7 +187,7 @@ you should do:

```js
// This import loads the firebase namespace.
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';

// These imports load individual services into the firebase namespace.
import 'firebase/auth';
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
Typescript:
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
`);

Expand Down
8 changes: 4 additions & 4 deletions packages/rxfire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Make sure to install Firebase and RxJS individually as they are peer dependencie
## Example use:

```ts
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/firestore';
import { collectionData } from 'rxfire/firestore';
import { tap } from 'rxjs/operators';
Expand All @@ -49,7 +49,7 @@ RxJS provides multiple operators and creation methods for combining observable s
The example below streams a list of "cities" from Firestore and then retrieves their image from a Cloud Storage bucket. Both tasks are asynchronous but RxJS makes it easy to combine these tasks together.

```ts
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/storage';
import { collectionData } from 'rxfire/firestore';
Expand Down Expand Up @@ -79,7 +79,7 @@ collectionData(citiesRef, 'id')
RxFire is a complementary library to Firebase. It is not meant to wrap the entire Firebase SDK. RxFire's purpose is to simplify async streams from Firebase. You need to import the Firebase SDK and initialize an app before using RxFire.

```ts
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/storage'; // import only the features needed
import { getDownloadURL } from 'rxfire/storage';

Expand All @@ -104,7 +104,7 @@ import { } from 'rxfire/functions';
RxFire is a set of functions. Most functions create observables and from there you can use regular RxJS operators. Some functions are custom operators. But at the end of the day, it's all just functions. This is important for **tree shaking**. Any unused functions are stripped from your final build if you use a module bundler like Webpack or Rollup.

```ts
import * as firebase from 'firebase/app';
import firebase from 'firebase/app';
import 'firebase/storage';
import { getDownloadURL, put /* not used! */ } 'rxfire/storage';

Expand Down
12 changes: 6 additions & 6 deletions packages/rxfire/docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `fromTask()` function creates an observable that emits progress changes.
#### TypeScript Example
```ts
import { fromTask } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand Down Expand Up @@ -43,7 +43,7 @@ The `percentage()` function creates an observable that emits percentage of the u
#### TypeScript Example
```ts
import { percentage } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand Down Expand Up @@ -73,7 +73,7 @@ The `getDownloadURL()` function creates an observable that emits the URL of the
#### TypeScript Example
```ts
import { getDownloadURL } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand All @@ -100,7 +100,7 @@ The `getMetadata()` function creates an observable that emits the URL of the fil
#### TypeScript Example
```ts
import { getMetadata } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand All @@ -127,7 +127,7 @@ The `put()` function creates an observable that emits the upload progress of a f
#### TypeScript Example
```ts
import { put } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand Down Expand Up @@ -157,7 +157,7 @@ The `putString()` function creates an observable that emits the upload progress
#### TypeScript Example
```ts
import { putString } from 'rxfire/storage';
import * as firebase from 'firebase';
import firebase from 'firebase';
import 'firebase/storage';

// Set up Firebase
Expand Down

0 comments on commit 7c15fb0

Please sign in to comment.