concept event in category svelte

appears as: event, events, n event, event
Svelte and Sapper in Action

This is an excerpt from Manning's book Svelte and Sapper in Action.

Now we can enter a name, but it doesn’t change the greeting. We need to add event handling so the value of the name variable is updated when the user types in the input. We can do this using an inline arrow function or a reference to a function defined in the script element. Change the input to the following:

  • Events are used to notify a parent component that something has happened in a child component, and they optionally include data in the event object that is passed to the parent.
  • <slot>Thanks for nothing!</slot>