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
7
7
8
8
# collectionStore
9
9
10
- Subscribes to Firestore collection data and listens to realtime updates.
10
+ Subscribes to Firestore collection data and listens to real-time updates.
11
11
12
12
### Parameters
13
13
@@ -22,10 +22,10 @@ Subscribes to Firestore collection data and listens to realtime updates.
22
22
import { collectionStore } from 'sveltefire';
23
23
import { firestore } from '$lib/firebase'; // your firestore instance
24
24
25
- const post = collectionStore(firestore, 'posts');
25
+ const posts = collectionStore(firestore, 'posts');
26
26
</script>
27
27
28
- {#each $post as post}
28
+ {#each $posts as post}
29
29
<p>{post.title}</p>
30
30
{/each}
31
31
```
@@ -56,8 +56,10 @@ With TypeScript:
56
56
content?: string;
57
57
}
58
58
59
- const post = collectionStore<Post>(firestore, 'posts');
59
+ const posts = collectionStore<Post[] >(firestore, 'posts');
60
60
</script>
61
61
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