You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -173,11 +182,12 @@ var app = firebase.initializeApp({ ... });
173
182
// ...
174
183
```
175
184
176
-
If you are using native ES6 module with --experimental-modules flag, you should do:
185
+
If you are using native ES6 module with --experimental-modules flag (or Node 12+)
186
+
you should do:
177
187
178
188
```js
179
189
// This import loads the firebase namespace.
180
-
importfirebasefrom'firebase/app';
190
+
import*asfirebasefrom'firebase/app';
181
191
182
192
// These imports load individual services into the firebase namespace.
183
193
import'firebase/auth';
@@ -186,7 +196,6 @@ import 'firebase/database';
186
196
187
197
_Known issue for typescript users with --experimental-modules: you have to set allowSyntheticDefaultImports to true in tsconfig.json to pass the type check. Use it with caution since it makes the assumption that all modules have a default export, which might not be the case for the other dependencies you have. And Your code will break if you try to import the default export from a module that doesn't have default export._
188
198
189
-
190
199
Firebase Storage is not included in the server side Firebase npm module.
Copy file name to clipboardExpand all lines: packages/rxfire/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Make sure to install Firebase and RxJS individually as they are peer dependencie
26
26
## Example use:
27
27
28
28
```ts
29
-
importfirebasefrom'firebase/app';
29
+
import*asfirebasefrom'firebase/app';
30
30
import'firebase/firestore';
31
31
import { collectionData } from'rxfire/firestore';
32
32
import { tap } from'rxjs/operators';
@@ -49,7 +49,7 @@ RxJS provides multiple operators and creation methods for combining observable s
49
49
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.
50
50
51
51
```ts
52
-
importfirebasefrom'firebase/app';
52
+
import*asfirebasefrom'firebase/app';
53
53
import'firebase/firestore';
54
54
import'firebase/storage';
55
55
import { collectionData } from'rxfire/firestore';
@@ -79,7 +79,7 @@ collectionData(citiesRef, 'id')
79
79
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.
80
80
81
81
```ts
82
-
importfirebasefrom'firebase/app';
82
+
import*asfirebasefrom'firebase/app';
83
83
import'firebase/storage'; // import only the features needed
84
84
import { getDownloadURL } from'rxfire/storage';
85
85
@@ -104,7 +104,7 @@ import { } from 'rxfire/functions';
104
104
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.
105
105
106
106
```ts
107
-
importfirebasefrom'firebase/app';
107
+
import*asfirebasefrom'firebase/app';
108
108
import'firebase/storage';
109
109
import { getDownloadURL, put/* not used! */ } 'rxfire/storage';
0 commit comments