Skip to content

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 ​

ParameterType
statePick<NegotiationState, "signalingState">

Returns ​

boolean

Talkline documentation