Phong Duong

🔎Search

Create event dispatcher in Svelte

14-08-2020 | #svelte

To create a event dispatcher, you need to createEventDispatcher function from Svelte. This will return a dispatch function and you will use it to forward event to the parent component

import { createEventDispatcher } from "svelte";

const dispatch = createEventDispatcher();

Share: TwitterFacebookLinkedInHacker News