import { useUserGdms } from '@towns-protocol/react-sdk'
useGdm
import { useUserGdms, useGdm } from '@towns-protocol/react-sdk' const AllGdms = () => { const { streamIds } = useUserGdms() return <>{streamIds.map((streamId) => <Gdm key={streamId} streamId={streamId} />)}</> } const Gdm = ({ streamId }: { streamId: string }) => { const { data: gdm } = useGdm(streamId) return <div>{gdm.metadata?.name || 'Unnamed Gdm'}</div> }
function useUserGdms( config?: ObservableConfig.FromObservable<Gdms>, ): { error: Error | undefined; status: "loading" | "loaded" | "error"; isLoading: boolean; isError: boolean; isLoaded: boolean; streamIds: string[]; }
ObservableConfig.FromObservable<Gdms>
{ error: Error | undefined; status: "loading" | "loaded" | "error"; isLoading: boolean; isError: boolean; isLoaded: boolean; streamIds: string[]; }
Was this page helpful?