Files
yaak/src-web/hooks/useLatestGrpcConnection.ts
2025-11-23 08:38:13 -08:00

8 lines
351 B
TypeScript

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