Day 5, part two — the MediaQuery stuff is powered by createSubscriber, which is an advanced feature mainly for library authors. It makes it easy for you to build your own reactive classes that set up event listeners when something is read inside an effect.
- docs https://svelte.dev/docs/svelte/svelte-reactivity#createSubscriber
- docs https://svelte.dev/docs/svelte/svelte-reactivity#createSubscriber
Comments
🎁 tutorial https://svelte.dev/tutorial/svelte/tweens
🎁 docs https://svelte.dev/docs/svelte/svelte-motion
🎁 demo https://svelte.dev/playground/8a021b2ec2064230bde4a10b08464876?version=5.8.0
🎁 https://svelte.dev/tutorial
bind:value={getValue, setValue}
...which lets you transform and validate data
🎁 docs https://svelte.dev/docs/svelte/bind#Function-bindings
🎁 demo https://svelte.dev/playground/1ddd82f573b94201b3c8fcab33bf0a46?version=5.9.0
get/set continues to chalk up wins
🎁 demo https://svelte.dev/playground/8095884c1f5040ea846669b904083e25?version=5.10.0
🎁 docs https://svelte.dev/docs/kit/hooks#Shared-hooks-init
🎁 docs https://svelte.dev/docs/svelte/svelte-reactivity-window
🎁 demo https://svelte.dev/playground/8ac86e10fdce485a99c29c95e0092df4?version=5.11.0
The same would be nice for `+page.js` and `+layout.ts` load functions.