brunnerh

Results 329 comments of brunnerh

> Binding to a value on a checkbox may actually make sense from a UX perspective. It does not make sense because the input will never change it in response...

I was _only_ referring to ``, which is where the error is shown because that input does _not_ change its own value.

> Is this supposed to work like that? I was about to note that you seem to have a serious misunderstanding about what bindings are. They exist only to enable...

Destructuring can be made reactive via `$derived`, by the way: ```js const { pressed, ...events } = $derived(createPressWatcher()); ``` [REPL](https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACm1Qy2qEMBT9lRAKoyDOXu1A_2B2XdQurF7bDHoTcm9si-TfS3R8lHEVcnJeOaNsVQcks7dRYtWDzOSLMTKR_GvChQboGGQiSTtbB6Sg2irDlxJLVr3RlsUoagsVw9UC0WvF9RdY4UVrdS9O6dns4HQ2TG90yksMHrVGChYTC5pEpGkKAyCT8OJZPDVg1QBN9BgRxXFeYnHeCmHx4Zg1inE18VPR62yeifEe44NwJl9kInvdqFZBIzO2DnyyjnHQfRvnRvth4Gcao3VYs9J4sEkUizG06YCX74YfElcMUVt1BPF9lNVEY68dQaO_cVGXvGlD2yBhf6xz5kg1Re1lFthZXIifW71NvZLuL_kM-2Q-dz3_I85MOXmJ_nHnd_8HfS-ZRYACAAA=)

@trueadm *How* relevant is this to performance? I think this might be quite pernicious (and documentation usually will not cut it).

You can nest the data in a simple wrapper, then create a new wrapper in the assignment. The actual data itself will not need to be copied. ```js let obj...

If you need encapsulation, you can use a private field. ```js class MyClass { #state = $state(false); onclick() { console.log(this.#state); } }; ```

That is not the same. TypeScript `private` qualified properties just try to enforce access/hide the property in the types but the property is not actually private at runtime. [*Real* private...

Regarding the error, see this issue: - #11306 The fix is implemented and deployed to the REPL but has not been published in `@next` it seems.