@towns-protocol/react-sdk
Version:
React Hooks for Towns Protocol SDK
22 lines • 728 B
JavaScript
'use client';
import { useAction } from './internals/useAction';
import { useSyncAgent } from './useSyncAgent';
/**
* Hook to create a space.
* @param config - Configuration options for the action.
* @returns The `createSpace` action and its loading state.
*/
export const useCreateSpace = (config = {}) => {
const sync = useSyncAgent();
const { action: createSpace, ...rest } = useAction(sync.spaces, 'createSpace', config);
return {
/**
* Action to create a space.
* @param opts - Options for the create space action.
* @param signer - The signer used to create the space.
*/
createSpace,
...rest,
};
};
//# sourceMappingURL=useCreateSpace.js.map