Adam L Barrett
Definition of svelte
SLENDER, LEAN, LITHE
having clean lines
SLEEK
URBANE, SUAVE
<h1>Hello {name}!</h1>
{
"type": "Element",
"name": "h1",
"children": [
{
"type": "Text", "raw": "Hello ", "data": "Hello "
},
{
"type": "MustacheTag", "expression": {
"type": "Identifier",
"name": "name"
}
},
{
"type": "Text", "raw": "!", "data": "!"
}
]
}
function instance($$self, $$props, $$invalidate) {
let { name = 'world' } = $$props;
$$self.$set = $$props => {
if ('name' in $$props) {
$$invalidate('name', (name = $$props.name));
}
};
return { name };
}
HTML
AST
JS
const app = new App({
target: document.body,
props: {
answer: 42
}
});
model.set('property', value)
model.get('property')
model.property = value
model.property