adjust docs

pull/2825/head
Conduitry 6 years ago
parent 5ecdc52a61
commit b274e4598f

@ -366,22 +366,24 @@ Components can emit events using [createEventDispatcher](docs#createEventDispatc
<SomeComponent on:whatever={handler}/> <SomeComponent on:whatever={handler}/>
``` ```
It's also possible to have multiple event listeners that react on the same event: ---
It's possible to have multiple event listeners for the same event:
```html ```html
<script> <script>
let counter; let counter = 0;
function increment() { function increment() {
counter = counter + 1; counter = counter + 1;
} }
function track(event) { function track(event) {
trackEvent(event) trackEvent(event)
} }
</script> </script>
<button on:click="{increment}" on:click="{track}">Click me!</button> <button on:click={increment} on:click={track}>Click me!</button>
```html ```
--- ---
@ -1324,4 +1326,4 @@ It accepts a comma-separated list of variable names (not arbitrary expressions).
{@debug typeof user === 'object'} {@debug typeof user === 'object'}
``` ```
The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables.
Loading…
Cancel
Save