Appearance
Function: shouldApplyAnswer()
ts
function shouldApplyAnswer(state): boolean;Whether an arriving answer is one we asked for.
An answer in any state but have-local-offer is either a duplicate or the far end answering an offer we rolled back, and applying it throws InvalidStateError — which reads in a log as a negotiation failure rather than as the collision it actually is.
Parameters
| Parameter | Type |
|---|---|
state | Pick<NegotiationState, "signalingState"> |
Returns
boolean