guy-with-dog

i'm the guy with bueller

hi hello i post dog. this guy, specifically:

beautiful lovely dog
he loves you, and hopes you love yourself too. i want him to be a candle in the dark, i.e. not really doing much, sure, but still there. something to hold onto if you need it.


lexi
@lexi

i love svelte to death but sometimes the sticking to vanilla js approach1 sometimes leads to constructs like $:$store = value2 lol


  1. the new syntax they introduce is overwriting vanilla js behavior, so all svelte files are, while being nonsensical sometimes, valid html containing valid js

  2. if you're curious: $:3 means "this statement is reactive", and $variable = value is the equivalent of writing to the destination of a pointer, but with a store instead of a pointer. the $ is like a deref. so $:$ means "reactively dereference a store".

  3. [identifier] : [expression] is valid syntax: it is a label4 named $5!

  4. see MDN / Web / JS / Reference / Statements / label and Svelte / Reactivity / Declarations

  5. yes, the naming is not the best. but to be fair they really do not have a lot of room there, if they just use valid JS syntax1,6 they have to stick with identifiers being /[a-zA-Z$_][a-zA-Z0-9$_]*, and _ is already used a lot so they cant really take that

  6. recursive & self-referencing footnotes are fun


guy-with-dog
@guy-with-dog

the footnote to content ratio of this post makes it feel like a poem


You must log in to comment.

in reply to @lexi's post:

Pinned Tags