-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add way to change bar programmatically without triggering listeners #652
base: master
Are you sure you want to change the base?
Conversation
@narfman0 too many booleans already, in my opinion even one can sometimes result in ambiguous meaning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
updateSelectedTab
basically 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