Skip to content

Function: useClientValue() ​

ts
function useClientValue<T>(
   client, 
   events, 
   compute, 
   isEqual?, 
   inputs?
): T;

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterTypeDefault valueDescription
clientTalklineClientundefined-
eventskeyof ClientEvents[]undefined-
compute() => Tundefined-
isEqual(a, b) => booleanObject.is-
inputsreadonly unknown[][]What compute reads besides the client — a hook argument. When these change the value is recomputed in the same render, React's pattern for state that follows a prop. Without it useTracks(p) recomputed on events only, and a component handed another participant rendered the previous one's tracks until something happened in the room.

Returns ​

T

Talkline documentation