Hook to get the members userIds of a Space, GDM, Channel, or DM. Used with useMember to get data from a specific member.

Imports

import { useMemberList } from '@river-build/react-sdk'

Definition

function useMemberList(
  streamId: string,
  config?: ObservableConfig.FromData<MembersModel>,
): {
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
} | {
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
} | {
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
}

Source: useMemberList

Parameters

streamId

  • Type: string

The id of the stream to get the members of.

config

  • Type: ObservableConfig.FromData<MembersModel>
  • Optional

Configuration options for the observable.

Return Type

The MembersModel of the stream, containing the userIds of the members.

{
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
} | {
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
} | {
    data: MembersModel;
    error: Error | undefined;
    status: "error" | "loading" | "loaded";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
}