Appearance
Function: useClientValue()
ts
function useClientValue<T>(
client,
events,
compute,
isEqual?,
inputs?
): T;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
client | TalklineClient | undefined | - |
events | keyof ClientEvents[] | undefined | - |
compute | () => T | undefined | - |
isEqual | (a, b) => boolean | Object.is | - |
inputs | readonly 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