fix(tutorial): naming paragraph language fixes

Co-Authored-By: Antony Jones <ant@enzy.org>
pull/4639/head
Alexis Ménard 6 years ago committed by GitHub
parent c5aec5f2d0
commit 6394fa11e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,7 @@ Components can also dispatch events. To do so, they must create an event dispatc
> `createEventDispatcher` must be called when the component is first instantiated — you can't do it later inside e.g. a `setTimeout` callback. This links `dispatch` to the component instance. > `createEventDispatcher` must be called when the component is first instantiated — you can't do it later inside e.g. a `setTimeout` callback. This links `dispatch` to the component instance.
Notice how the `App.svelte` component, that is including `Inner.svelte`, is listening to the messages dispatched by `Inner` thanks to the `on:message` attribute. This attribute is named with `on:` followed by the event name that we are dispatching (here, `message`). Notice that the `App` component is listening to the messages dispatched by `Inner` component thanks to the `on:message` directive. This directive is an attribute prefixed with `on:` followed by the event name that we are dispatching (in this case, `message`).
Without this attribute, messages would still be dispatched, but the App would not react to it. You can try removing the `on:message` attribute and pressing the button again. Without this attribute, messages would still be dispatched, but the App would not react to it. You can try removing the `on:message` attribute and pressing the button again.

Loading…
Cancel
Save