Files
yaak-mountain-loop/apps/yaak-client/hooks/useLatestGrpcConnection.ts
2026-05-07 15:50:10 -07: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;
}