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
@@ -174,7 +167,7 @@ Second, pass the server data as the `startWith` value to a store. This will bypa
174
167
exportlet data:PageData;
175
168
176
169
// Just give the store a startWith value
177
-
const post =docStore('posts/test', data.post);
170
+
const post =docStore(firestore, 'posts/test', data.post);
178
171
```
179
172
180
173
## Realtime Components
@@ -183,9 +176,10 @@ In addition to stores, SvelteFire provides a set of components that can build co
183
176
184
177
### FirebaseApp
185
178
186
-
The `FirebaseApp` component puts the FirebaseSDK into Svelte context. This avoids the need to pass `auth` and `firestore` down to every component/store. It is typically placed in root layout.
179
+
The `FirebaseApp` component puts the FirebaseSDK into Svelte context. This avoids the need to pass `auth` and `firestore` down to every component. It is typically placed in root layout.
187
180
188
181
```svelte
182
+
<!-- +layout.svelte -->
189
183
<script>
190
184
// Initialize Firebase...
191
185
const db = getFirestore(app);
@@ -200,7 +194,7 @@ The `FirebaseApp` component puts the FirebaseSDK into Svelte context. This avoid
200
194
</FirebaseApp>
201
195
```
202
196
203
-
You can easily access the Firebase SDK in any component via context. This is useful when using the Firebase SDK directly, which requires the SDK as an argument.
197
+
You can use Svelte's context API to access the Firebase SDK in any component.
204
198
205
199
```svelte
206
200
<script>
@@ -295,7 +289,6 @@ These components can be combined to build complex realtime apps. It's especially
0 commit comments