Skip to content

Commit c326e17

Browse files
authored
Merge pull request codediodeio#111 from Syed-Sheharyar/master-1
Change variable name db to firestore and grammar fixes.
2 parents 211876d + d99c2bc commit c326e17

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

docs/src/pages/firestore/collection-store.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layout: ../../layouts/MainLayout.astro
77

88
# collectionStore
99

10-
Subscribes to Firestore collection data and listens to realtime updates.
10+
Subscribes to Firestore collection data and listens to real-time updates.
1111

1212
### Parameters
1313

@@ -22,10 +22,10 @@ Subscribes to Firestore collection data and listens to realtime updates.
2222
import { collectionStore } from 'sveltefire';
2323
import { firestore } from '$lib/firebase'; // your firestore instance
2424
25-
const post = collectionStore(firestore, 'posts');
25+
const posts = collectionStore(firestore, 'posts');
2626
</script>
2727
28-
{#each $post as post}
28+
{#each $posts as post}
2929
<p>{post.title}</p>
3030
{/each}
3131
```
@@ -56,8 +56,10 @@ With TypeScript:
5656
content?: string;
5757
}
5858
59-
const post = collectionStore<Post>(firestore, 'posts');
59+
const posts = collectionStore<Post[]>(firestore, 'posts');
6060
</script>
6161
62-
{$post?.title}
63-
```
62+
{#each $posts as post}
63+
<p>{post.title}</p>
64+
{/each}
65+
```

docs/src/pages/guide/start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm i sveltefire firebase
1818

1919
### 2. Initialize
2020

21-
Initialize Firebase and add the `FirebaseApp` component to the component tree. Typically, this is done in the root `+layout.svelte` file to access Firebase in all pages.
21+
Initialize Firebase and add the `FirebaseApp` component to the component tree. Typically, this is done in the root `+layout.svelte` file to access Firebase on all pages.
2222

2323
#### +layout.svelte
2424
```svelte
@@ -30,7 +30,7 @@ Initialize Firebase and add the `FirebaseApp` component to the component tree. T
3030
3131
// Initialize Firebase
3232
const app = initializeApp(/* your firebase config */);
33-
const db = getFirestore(app);
33+
const firestore = getFirestore(app);
3434
const auth = getAuth(app);
3535
</script>
3636

0 commit comments

Comments
 (0)