The way you start (By adding an event dispatcher) is not the easiest way. For a simple component as the button you are using is, just adding on:click will handle the even dispatching just fine. Dispatchers are for more complicated stuff.
Thanks great overview I am really interested in svelte, at the moment I am creating a components based app in vanilla javascript to really understand the underlying concepts. Du you have an suggestion how to write a template parser like createEventDispatcher, so you can connect attribute-like statements like on:click which execute functions which are not oo the window object?
I think you need to talk about event forwarding just by writing on:event in child component, also more about event modifiers
ah you're right, i forgot to mention how to do event forwarding! But here's a video I have on event modifiers th-cam.com/video/Sj5Dskbphnk/w-d-xo.html
Nice Video, looking forward for more such content!
The way you start (By adding an event dispatcher) is not the easiest way.
For a simple component as the button you are using is, just adding on:click will handle the even dispatching just fine.
Dispatchers are for more complicated stuff.
True, maybe I hadn’t learned about event forwarding yet
lol i love the smiley sign up!! thanks
Just use preventDefault, if you don't want the form to submit .. no need to use a different type of button
True, that’s one way to do it!
good content
Thanks great overview
I am really interested in svelte, at the moment I am creating a components based app in vanilla javascript to really understand the underlying concepts.
Du you have an suggestion how to write a template parser like createEventDispatcher, so you can connect attribute-like statements like on:click which execute functions which are not oo the window object?
Hmm that sounds hard. Sorry, i don’t have any ideas. I’m curious, why do you want to do that?
Possibly make a TypeScript guide?
here you go th-cam.com/video/tFeJKQdzzvo/w-d-xo.html
@@SvelteMastery Nice, we appreciate your work my friend.