Video details

Svelte Question - Why do we need createEventDispatcher?

Svelte
05.30.2021
English

✨❓ Svelte Question Time ❓✨
"You have a Svelte question, I have an answer" 😱😍
Why do we need createEventDispatcher?
When creating component events, why do we have to import createEventDispatcher, create a dispatch function, and use it? Why can't we import `dispatch` directly and use it?
What is happening when we call `createEventDispatcher`?
---
📝 Codesandbox https://codesandbox.io/s/svelte-why-do-we-need-create-event-dispatcher-dtxk6
🎧 Svelte Tutorial for Beginners https://www.youtube.com/playlist?list=PLoKaNN3BjQX3mxDEVG3oGJx2ByXnue_gR 🎧 Svelte Question Time https://www.youtube.com/playlist?list=PLoKaNN3BjQX1I9FmIoCaws4vUaoqezpc1
📚
Related Resources Svelte https://svelte.dev Svelte REPL https://svelte.dev/repl
🥰 Support me https://www.buymeacoffee.com/lihautan
🔗
Want to learn more from me? Check out these links:
Twitter: https://twitter.com/lihautan Blog: https://lihautan.com/ Newsletter: https://lihautan.com/newsletter
#svelte #sveltequestiontime
Thanks for watching 🥰 -- with love, Li Hau