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
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,10 @@ Create a Svelte App and install Firebase.
47
47
48
48
```bash
49
49
npx degit sveltejs/template fireapp
50
-
cd fireapp
50
+
cd fireapp
51
+
npm install
51
52
52
-
npm i && npm install sveltefire firebase
53
+
npm install sveltefire firebase
53
54
```
54
55
55
56
@@ -226,11 +227,19 @@ You can bypass the loading state entirely by passing a `startWith` prop.
226
227
</Doc>
227
228
```
228
229
230
+
### Events
231
+
232
+
[Events](https://svelte.dev/tutorial/component-events)**emit data up** to the parent. You can use components as a mechanism to read documents without actually rendering UI. Also useful for trigging side effects.
Components are reactive. When the input props change, they unsubscribe from the last stream and start a new one.
240
+
Components are reactive. When props change, they unsubscribe from the last stream and start a new one. This means you can change the document path or query function by simplying changing a prop value.
232
241
233
-
Example: Collections have a special slot props for pagination called `first` and `last`. Use them to create reactive pagination queries.
242
+
Example: Collections have special slot props for pagination called `first` and `last`. Use them to create reactive pagination queries.
234
243
235
244
236
245
```html
@@ -254,14 +263,6 @@ function nextPage(last) {
254
263
</Collection>
255
264
```
256
265
257
-
### Events
258
-
259
-
[Events](https://svelte.dev/tutorial/component-events)**emit data up** to the parent. You can use components as a mechanism to read documents without actually rendering UI. Also useful for trigging side effects.
[Stores](https://svelte.dev/tutorial/custom-stores) are used under the hood to manage async data in components. It's an advanced use-case, but they can be used directly in a component script or plain JS.
0 commit comments