My new noob @sveltejs discovery: You might NOT need $derived!
For simple expressions, put it straight into your markup. They're still reactive!
$derived is useful for reactive **variable** w/ a complex expression and/or to be re-used many times. But otherwise, I prefer simple
More reason to love @DrizzleORM for me:🆕 "drizzle-seed" just dropped last week 🌱
- Just pass in your schema
- Intelligent default generators
- Ability to further refine generation
- Seed relationships too
- Utility to reset whole table
drizzle-seed now on Drizzle 0.36.4!
The "writable derived" is an incredible Svelte trick I just learned from @joyofcodedev
🚩 Problem: 2-way sync btw two states, but can't use "$derived" because it's 1-way readonly
→ ✅Use an object with get/set
Here, typing activate checking, and unchecking also reset email
TIL: A <button> element inside a <label> element will not work, as the button captures the click for itself and doesn't pass it to the label at all.
Greedy buttons.