Files
yaak/src-web/hooks/useLatestGrpcConnection.ts
2025-03-31 11:56:17 -07:00

8 lines
356 B
TypeScript

import type { GrpcConnection} from '@yaakapp-internal/models';
import { grpcConnectionsAtom } from '@yaakapp-internal/models';
import { useAtomValue } from 'jotai/index';
export function useLatestGrpcConnection(requestId: string | null): GrpcConnection | null {
return useAtomValue(grpcConnectionsAtom).find((c) => c.requestId === requestId) ?? null;
}