Generalized frontend model store (#193)

This commit is contained in:
Gregory Schier
2025-03-31 11:56:17 -07:00
committed by GitHub
parent ce885c3551
commit f1757ae427
201 changed files with 2185 additions and 2865 deletions

View File

@@ -1,6 +1,7 @@
import type { GrpcConnection } from '@yaakapp-internal/models';
import { useGrpcConnections } from './useGrpcConnections';
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 useGrpcConnections().find((c) => c.requestId === requestId) ?? null;
return useAtomValue(grpcConnectionsAtom).find((c) => c.requestId === requestId) ?? null;
}