4 ms·
I'm still very skeptical of the random templating syntax, of the weird reactivity with gotchas and most of all, of two way databinding. Wasn't two way databindi
by shirogane86x 4y ago
I'm still very skeptical of the random templating syntax, of the weird reactivity with gotchas and most of all, of two way databinding. Wasn't two way databinding one of the reasons we got react (and one of the reasons i bought into it) back when angular was the go-to? I feel like every time i try to use two-way-databinding it ends up in a jumbled unintelligible mess where I'm chasing mutations around... Personally, if I have to try out a new framework, I'll probably try out solid instead.
- swyx 4y agosvelte’s 2 way data binding is only within a component, and actually is 1 way if you look at the compiled output. very different than say angular, and pretty much equivalent to what you manually write with setState calls. this is such a common misconception i feel like we should put this in the FAQ somewhere. people are fixating on the wrong thing when they go “oh ho 2 way binding bad”. its local and its compiled away, its fine.
- shirogane86x 4y agoThank you very much for the explanation! I agree with you that this information should be somewhere, especially seeing as I (mistakenly) thought that too, I probably would've had less of a knee-jerk reaction to it if I knew that it's effectively syntax sugar. I'm guessing I'm not the only one who has really bad memories of angular... Sorry for the misunderstanding!
- swyx 4y agoyeah no worries it’s a very common superficial reaction! we just spend a lot of time explaining it: https://twitter.com/rich_harris/status/1420214295242199041?s=21&t=oT1R6bfLJpHjRu7ugYaMEw https://twitter.com/rich_harris/status/1420214295242199041?s... https://twitter.com/rich_harris/status/1147902393293688834?s=21&t=oT1R6bfLJpHjRu7ugYaMEw https://twitter.com/rich_harris/status/1147902393293688834?s... https://www.swyx.io/svelte-why#two-way-binding https://www.swyx.io/svelte-why#two-way-binding