mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 03:13:33 +02:00
Generalized frontend model store (#193)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user