Hook to create a channel.
Imports
import { useCreateChannel } from '@towns-protocol/react-sdk'
Definition
function useCreateChannel(
spaceId: string,
config?: ActionConfig<Space["createChannel"]>,
): {
data: string | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
createChannel: (channelName: string, signer: Signer, opts?: {
topic?: string;
} | undefined) => Promise<string>;
}
Source: useCreateChannel
Parameters
spaceId
config
- Type:
ActionConfig<Space["createChannel"]>
- Optional
Configuration options for the action.
Return Type
The createChannel
action and its loading state.
{
data: string | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
createChannel: (channelName: string, signer: Signer, opts?: {
topic?: string;
} | undefined) => Promise<string>;
}