The single-spa ecosystem Version: 5.x The single-spa ecosystem The single-spa ecosystem is quickly growing to support as many frameworks and build tools as possible. There is ...
If blocks If blocks HTML doesn’t have a way of expressing logic, like conditionals and loops. Svelte does. To conditionally render some markup, we wrap it in an if block: {...
Declaring props Declaring props So far, we’ve dealt exclusively with internal state — that is to say, the values are only accessible within a given component. In any real app...
Writable stores Writable stores Not all application state belongs inside your application’s component hierarchy. Sometimes, you’ll have values that need to be accessed by mult...
App Layout Basic Layout Advanced Layout Initialize App App Layout First thing we should do for our App is to create index.html file with app’s skeleton. <!DOCTYPE html> <...
Inline handlers Inline handlers You can also declare event handlers inline: <div on:mousemove = "{e => m = { x: e.clientX, y: e.clientY }}"> The mouse position is {m...
Event modifiers Event modifiers DOM event handlers can have modifiers that alter their behaviour. For example, a handler with a once modifier will only run a single time: <s...