Svelte Tutorial for Beginners - tick()

Опубликовано: 04 Январь 2025
на канале: lihautan
4,403
271

We've learned about reactivity and reactive declarations and statements, it's time to know about the tick() function

tick() allows you to wait for all pending updates to be applied to the DOM.

In this video, I am showing 2 examples of how you could use tick() in your Svelte component.


Introduction 00:00
First example - wait for reactive declared variables to be updated 00:45
Second example - wait for updates to restore element state 05:23

---

💻 REPL https://svelte.dev/repl/a0e8adb569034...

🎧 Svelte Tutorial for Beginners    • Svelte Tutorial for Beginners  

📚 Related Resources
Svelte https://svelte.dev
Svelte REPL https://svelte.dev/repl
Svelte Tutorial: tick() https://svelte.dev/tutorial/tick

🥰 Support me https://www.buymeacoffee.com/lihautan

🔗 Want to learn more from me? Check out these links:

Twitter:   / lihautan  
Blog: https://lihautan.com/
Newsletter: https://lihautan.com/newsletter

#svelte #sveltetutorial #sveltebeginner

Thanks for watching 🥰 -- with love, Li Hau