File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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+ ```
You can’t perform that action at this time.
0 commit comments