© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. LibbyPractical Sveltehttps://doi.org/10.1007/978-1-4842-7374-6_4

4. Controlling Logic

Alex Libby1  
(1)
BELPER, UK
 

We’re making good progress with our demo site – we have the core components in place and can now manage data and the overall state of interacting with our customers.

So, what’s next? It’s time for decisions. Decisions such as “should element X be displayed, or should we show element Y?” “What happens if we log in or out – should the content on the page change?” These are just two questions I am sure developers will ask when determining what should happen if condition X becomes valid.

Controlling what happens is a fundamental part of any website; ...

Get Practical Svelte: Create Performant Applications with the Svelte Component Framework 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.