44
loading...
This website collects cookies to deliver better user experience
{#each things as thing (thing.id)}
<Thing name={thing.name}/>
{/each}
ref
, but interestingly enough it is not usually their recommended path for stores, based on how quickly it is outscaled.setState
, unidirectional flow, and immutable data. But Svelte just lets you assign values.const someData = { value: 5 };
someFunction(someData);
// do we know this is even true
someData.value === 5;
value
isn't even defined object anymore. You see this time and time again in system architecture the importance of providing read only interface with explicit setters. Using things like events or commands with a dispatch function. Even mutable reactive data stores like MobX recommend using Actions and have a strict mode to prevent writes except for where they are intended. In a reactive system this is doubly important as a change to some value can have cascading effects elsewhere in your app.let
variables are basically keyed to the component and can't escape the template, and Svelte's Stores are built using explicit syntax.