-
Notifications
You must be signed in to change notification settings - Fork 181
NumberSignal does not have decrementBy API #21596
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
Comments
Why isn't |
Debugging gets easier as you know which methods to track when looking for why the number is decreased. It would make api symmetrical. It is the first method that you think of when you need to decrease a number. |
It goes both ways. As long as I would guess the main problem is discoverability, but it does so far seem that users do find the |
I am not saying that incrementBy should reject negative values, but rather there should be a decrementBy API that can even call the incrementBy method with a negated delta value.
Except me 😆 I even opened the NumberSignal class and looked for a method that does a subtraction operation |
Describe your motivation
NumberSignal has incrementBy API, which is very convenient in most cases. It would be nice to have decrementBy API, as well.
Describe the solution you'd like
Introduce
decrementBy(double delta)
that decreases the value by the delta amountDescribe alternatives you've considered
I used the increment API with negative numbers.
Additional context
Additionally, some utility method would be nice e.g. incrementByOne(), decrementByOne()
The text was updated successfully, but these errors were encountered: