Closed ghost closed 5 years ago
Hi @Eric02 these lines are presumably there for giving the user immediate feedback upon click. This is one of the principles of good interaction design.
The counter-element's click property is also updated upon a state change in my-view2.js, that's why it is also working if you delete the mentioned lines. However, imagine if the action would result in a server round-trip. If the round-trip takes longer than the human perceivable limit between action-reaction (click-increase), it would be confusing for the user to have to wait (even just half a second) until the timer increases. Especially since the result is non-deterministic, i.e. clicking another time again increases the counter.
Hope this helps. 😃
It does, thank you! I did not think about that... still a lot to learn!
Hello,
I'm studying the code and I am trying to understand why lines 66, 67, 72, 73 were useful. When clicking the + and -, we are:
I deleted those lines and the app works fine. As I am learning, I wonder if these lines have another purpose.
Thank you for correcting my understanding if I am wrong.