Files
yaak-mountain-loop/apps/yaak-client/hooks/useLatestGrpcConnection.ts
2026-03-06 09:23:19 -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;
}