-
Notifications
You must be signed in to change notification settings - Fork 19
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
Can we rename setSelectedCandidatePair to selectCandidatePair ? #178
Comments
I don't think a setter attribute is a good fit here because:
Thinking also about @henbos's suggestion in #175 (review), perhaps an overall improvement, which also makes the verb more suitable, would be to change the method signature to Promise<undefined> setSelectedCandidatePair(RTCIceCandidatePair candidatePair); Then the sequence of operations on
Then the application knows when the setter completes and the getter is consistent with the result. The spec changes should be minimal. What do you think? |
Note I'm not proposing a setter attribute.
Right, I'm proposing calling the method Returning a promise seems orthogonal to naming, but I agree it would conveniently solve the issue of expected behavior by clarifying when the returned value should match await transceiver.transport.iceTransport.selectCandidatePair(foo);
const bar = transceiver.transport.iceTransport.getSelectCandidatePair();
// foo and bar should match |
Renaming this method SGTM |
Sorry for not catching this in review, but...
Is it too late to rename setSelectedCandidatePair to selectCandidatePair ?
Using the right verbs often helps when defining methods.
Also, "setFoo" methods are a bit of an anti-pattern I feel (they beg the question of whether something should have been a setter attribute instead.)
cc @sam-vi
The text was updated successfully, but these errors were encountered: