Hook to get the data of a Group DM. You can use this hook to get Group DM metadata and if the user has joined the Group DM.

Imports

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

Definition

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

Source: useGdm

Parameters

streamId

  • Type: string

The id of the Group DM to get the data of.

config

  • Type: ObservableConfig.FromData<GdmModel>
  • Optional

Configuration options for the observable.

Return Type

The GdmModel of the Group DM.

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