@towns-protocol/react-sdk
Version:
React Hooks for Towns Protocol SDK
22 lines • 793 B
JavaScript
'use client';
import { useAction } from './internals/useAction';
import { useSyncAgent } from './useSyncAgent';
/**
* A hook that allows you to create a new group direct message (GDM).
* @param config - The action config.
* @returns An object containing the `createGDM` action and the rest of the action result.
*/
export const useCreateGdm = (config) => {
const sync = useSyncAgent();
const { action: createGDM, ...rest } = useAction(sync.gdms, 'createGDM', config);
return {
/**
* Creates a new GDM.
* @param userIds - The `userIds` of the users to invite to the GDM.
* @returns A promise that resolves to the result of the create operation.
*/
createGDM,
...rest,
};
};
//# sourceMappingURL=useCreateGdm.js.map