Let's take a look at this powerful feature that you don't want to miss out in Svelte, Reactive Declarations and Statements.
As we work through the example, you will see how handy reactive declarations & statements can be!
I'll explain how reactive declarations & statements works, and what to watch out when using them, including - what are the dependencies of a reactive declarations / statements? - when does Svelte evaluates a reactive declarations / statements? - does the order of reactive declarations / statement matters?
Hopefully with a good understanding on how reactive declarations / statements work, you can avoid most of the common pitfalls.
Introduction 00:00 Why we need reactive declarations and statements? 00:29 Reactive declarations 04:22 Reactive statements 06:57 What are the dependencies of a reactive declarations and statements? 07:48 When does Svelte evaluates a reactive declarations and statements? 11:31 Does the order of reactive declarations and statements matter 13:26
Related Resources Svelte https://svelte.dev Svelte REPL https://svelte.dev/repl Svelte Tutorials: Declarations https://svelte.dev/tutorial/reactive-declarations Svelte Tutorials: Statements https://svelte.dev/tutorial/reactive-statements
🥰 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
Thanks for watching 🥰 -- with love, Li Hau