henrykrinkle01

Results 21 comments of henrykrinkle01

To avoid reassignment: ```js function box(value: T): { current: T } { const boxed = $state({ current: $state.snapshot(value) }); return boxed; } const thing = $derived(box(array)); thing.current = otherArray; ```

I think it's possible to make `$derived($state(...))` or `$derived.xxx` work with reassignment without using a box. That would be an improvement from the current `$derived.by(...)` and a justification for a...

>Having a discoverable function ("hm, what's thing on $derived?") This is the most compelling argument I've seen for a new rune. `$derived($state(...))` is still kind of obscure

> A significant argument against a rune in my view is the inability to use it in a SvelteKit `load` functions. Why do you even need to use this feature...

>I like this. If this doesn't get implemented, it could be an idea to run by the Runed library. Kinda already existing though. You can check out various `box` versions...

I mean you gain almost nothing but headache by upgrading Svelte since you don't use any of the new features. So better stay at a stable version like 5.25.0 (don't...

I think that case is rare and if it is your intention to do so, you're free to add a ` // svelte-ignore state_referenced_locally`. OTOH, I've seen many times on...

Most of the time the page is static and doesn't receive real time update from the server like in your example. I'm talking about the web in general, not just...

The problem isn't with chained `$derived`. In your repro, if I skip the derived altogether it still errors. I found that if you use `$derived(await...)` in the `script` tag, you...

You sure the syntax is correct? This is working. ```diff -let result = $derived(await map(test(), (x) => x === +page.params.x)); +let result = $derived(map(await test(), (x) => x == page.params.x));...