-
-
Notifications
You must be signed in to change notification settings - Fork 164
Description
https://svelte.dev/docs/svelte/$bindable tells:
Ordinarily, props go one way, from parent to child. This makes it easy to understand how data flows around your app.
In Svelte, component props can be bound, which means that data can also flow up from child to parent. This isn’t something you should do often, but it can simplify your code if used sparingly and carefully.
I think it misses an explanation why it could be done but shouldn't be done often. Or just don't tell anything ?
Actually I see it as a big topic, because I feel that bidirectional binding allows local source of truth and component responsibility, which is the state of art of OOP / SASS / API. I've yet to be convinced why suddenly with UI it's different and the flow should only go one way, because it equals to global variables, which is known to be the enemy of scalability and responsibility.