Skip to content

Commit 58b0e03

Browse files
committed
doc: minor wording change
1 parent 4d506bd commit 58b0e03

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ Create a Svelte App and install Firebase.
4747

4848
```bash
4949
npx degit sveltejs/template fireapp
50-
cd fireapp
50+
cd fireapp
51+
npm install
5152

52-
npm i && npm install sveltefire firebase
53+
npm install sveltefire firebase
5354
```
5455

5556

@@ -226,11 +227,19 @@ You can bypass the loading state entirely by passing a `startWith` prop.
226227
</Doc>
227228
```
228229

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.
233+
234+
```html
235+
<Doc path={'food/ice-cream'} on:data={(e) => console.log(e.detail.data)} />
236+
```
237+
229238
### Reactive
230239

231-
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.
232241

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.
234243

235244

236245
```html
@@ -254,14 +263,6 @@ function nextPage(last) {
254263
</Collection>
255264
```
256265

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.
260-
261-
```html
262-
<Doc path={'food/ice-cream'} on:data={(e) => console.log(e.detail.data)} />
263-
```
264-
265266
### Stores
266267

267268
[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

Comments
 (0)