import { useCallback } from 'react';
import '../../../../../_virtual/index2.mjs';
import { useSWRConfig } from '../../../../../node_modules/swr/_internal/dist/index.mjs';
import { ssoGetConnectionsKey } from './useSsoConnections.mjs';
import { useStytchClient } from './useStytchClient.mjs';

const useRevalidateConnectionList = ()=>{
    const { mutate } = useSWRConfig();
    const client = useStytchClient();
    return useCallback(()=>{
        const orgId = client.organization.getSync()?.organization_id;
        if (orgId) {
            return mutate(ssoGetConnectionsKey(orgId));
        }
    }, [
        client.organization,
        mutate
    ]);
};

export { useRevalidateConnectionList };
//# sourceMappingURL=useRevalidateConnectionList.mjs.map
