Re: [webrtc-extensions] Can we rename setSelectedCandidatePair to selectCandidatePair ? (#178)

> I don't think a setter attribute is a good fit here because:

Note I'm not proposing a setter attribute.

> 1. `setSelectedCandidatePair` does not immediately mutate the internal slot returned by `getSelectedCandidatePair`, that only happens asynchronously.

Right, `setSelectedCandidatePair` seems a bad name for the same reason.

I'm proposing calling the method `selectCandidatePair`. This implies a method that is doing something (selecting) other than simply storing the value immediately.

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
```js
await transceiver.transport.iceTransport.selectCandidatePair(foo);
const bar = transceiver.transport.iceTransport.getSelectCandidatePair();
// foo and bar should match
```

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/issues/178#issuecomment-1785872303 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 30 October 2023 19:08:20 UTC