Skip to content

Commit d99c2bc

Browse files
Fixed examples of collection-store.md
Fixed examples of collection-store.md.
1 parent 5959049 commit d99c2bc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
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+
```

0 commit comments

Comments
 (0)