Hook to set the username of the current user in a stream.
Imports
import { useSetUsername } from '@towns-protocol/react-sdk'
Definition
function useSetUsername(
streamId: string,
config?: ActionConfig<Myself["setUsername"]>,
): {
data: void | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
setUsername: (username: string) => Promise<void>;
}
Source: useSetUsername
Parameters
streamId
The id of the stream to set the username of.
config
- Type:
ActionConfig<Myself["setUsername"]>
- Optional
Configuration options for the action.
Return Type
The setUsername
action and its loading state.
{
data: void | undefined;
error: Error | undefined;
isPending: boolean;
isSuccess: boolean;
isError: boolean;
setUsername: (username: string) => Promise<void>;
}