Add way to change bar programmatically without triggering listeners#652
Add way to change bar programmatically without triggering listeners#652narfman0 wants to merge 2 commits intoroughike:masterfrom
Conversation
|
@narfman0 too many booleans already, in my opinion even one can sometimes result in ambiguous meaning. |
yombunker
left a comment
There was a problem hiding this comment.
Find a different way of doing this, there are too many booleans, and you could easily do the same on your side, set a boolean and when the callback comes back you ignore it and reset the boolean.
|
You want another method, like You suggest adding a boolean, managing my own state, and taking different logic based on internals of the bottom bar library that now I have to know about. All that over an overloaded method with an added boolean. Why would clients want this? Clunky, unclear, design I don't want in my app(s). You saw #499 ? Currently as I said, having a helper function clear/reset the listeners before/after updating is the cleanest way for me. "too many booleans": Booleans are concise. |
Currently the easiest way to change without triggering a listener is something like:
This changeset exposes a way to avoid triggering listeners through the most likely call the user is already making. Previous API should behave the same, only users invoking this with triggerListeners (false) explicitly will see the difference.
Note:
updateSelectedTabbasically just calls listeners and updates currentTabPositon. I would have added triggerListeners there too, but it seems to be more like a setCurrentTabAndFireEvents :) so why nto just set current tab.Fixes #499