[docs] add more details about "Use component bindings sparingly"

pull/7141/head
cesare soldini 5 years ago committed by GitHub
parent de6c7c5d18
commit 9ead60e484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,4 +10,6 @@ Just as you can bind to properties of DOM elements, you can bind to component pr
Now, when the user interacts with the keypad, the value of `pin` in the parent component is immediately updated.
> Use component bindings sparingly. It can be difficult to track the flow of data around your application if you have too many of them, especially if there is no 'single source of truth'.
> Use component bindings sparingly. It can be difficult to track the flow of data around your application if you have too many of them, especially if there is no "single source of truth".
>
> In this particular case, a better approach would be: the Keypad component could dispatch events for every numerical key, and it could be responsibility of the parent to concatenate the entire pin in a `let pin` variable, making it a single source of truth. This would make the Keypad component more generic and reusable.

Loading…
Cancel
Save