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
Copy file name to clipboardExpand all lines: README.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,9 @@ Use the `$` as much as you want - it will only result in one Firebase read reque
80
80
Or better yet, use the built in `Doc` and `Collection` components. See below.
81
81
82
82
83
-
## Examples
83
+
## Stores
84
+
85
+
Stores are the building blocks of SvelteFire.
84
86
85
87
### Auth Store
86
88
@@ -100,7 +102,7 @@ Listen to the current user. Render UI conditionally based on the auth state:
100
102
{/if}
101
103
```
102
104
103
-
## Firestore Stores
105
+
###Firestore Stores
104
106
105
107
Subscribe to realtime data. The store will unsubscribe automatically to avoid unnecessary Firestore reads.
106
108
@@ -164,12 +166,11 @@ Technically optional, this component puts Firebase into Svelte context. This avo
164
166
<!-- other sveltefire components here -->
165
167
166
168
</FirebaseApp>
167
-
168
-
<!-- components outside context require the auth or firestore prop -->
169
-
<User auth={auth} let:user></User>
170
169
```
171
170
172
-
### User
171
+
Note: Components outside a FirebaseApp will need the auth/firestore prop, i.e `<User auth={auth}>`
172
+
173
+
#### User
173
174
174
175
Get the current user.
175
176
@@ -255,7 +256,7 @@ For complex queries that required dynamic data, it can be useful to build the qu
255
256
<Collection ref={buildQuery(user.uid)} />
256
257
</User>
257
258
```
258
-
### Putting it all Totgether
259
+
### Using Components Together
259
260
260
261
These components can be combined to build complex realtime apps. It's especially powerful when fetching data that requires the current user's UID or a related document's path.
261
262
@@ -290,9 +291,7 @@ These components can be combined to build complex realtime apps. It's especially
290
291
```
291
292
292
293
293
-
294
-
295
-
# Notes
294
+
## Notes
296
295
297
296
- This library should only run the the client, it is not for server-side data fetching.
0 commit comments