Svelte @svelte.dev · Dec 8

Day 8 — we're calling this 'function bindings'. You know how you can do `bind:value={value}`? You can now do this... bind:value={getValue, setValue} ...which lets you transform and validate data 🎁 docs svelte.dev/docs/svelte/... 🎁 demo svelte.dev/playground/1...

121 likes 8 replies

?

Replies

Ray Thurn Void · Dec 9

This and error boundaries are huge improvements to svelte, thanks!

Paulo Vieira · Dec 9

1/2 Huge new feature! But this definitely need more examples and clarification. For instance, it's not clear where the transformation/validation should be (it seems it can be in either "set" or "get", no?). It reminds of getters and setters in POJO, but the semantics seem to be different.

Čhepulis · Dec 9

The example is white-on-white when in dark mode (Safari).

@hanson190505.bsky.social · Dec 26

这非常酷

Ryan Atkinson · Dec 9

lovely feature, and a great example of the design restraint that serves Svelte so well, in addressing this issue with extra power and elegant syntax - github.com/sveltejs/sve... get/set continues to chalk up wins

Sámal Rasmussen · Dec 8

I have wanted this for years! 🎉

Svelte · Dec 9

Day 9 — warnings and errors emitted by the compiler, or while your app is running, are now accompanied by links to the docs. Over time, we'll flesh out these docs with more details about what caused the error in question 🎁 demo svelte.dev/playground/8...