Table of Contents
Preface
Part 1: Writing Svelte Components
1
Lifecycles in Svelte
Technical requirements
Understanding the Svelte lifecycle functions
Initializing the component
Mounting the component
Updating the component
Destroying the component
The one rule for calling lifecycle functions
Refactoring lifecycle functions
Which component to register?
Reusing lifecycle functions in Svelte components
Exercise 1 – Update counter
Composing lifecycle functions into reusable hooks
Coordinating lifecycle functions across components
Exercise 2 – Scroll blocker
Summary
2
Implementing Styling and Theming
Technical requirements
Styling Svelte components in six different ways
Styling with the style attribute
Using style: directives
Adding the <style> ...
Get Real-World Svelte now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.