mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-18 06:57:11 +01:00
14 lines
410 B
TypeScript
14 lines
410 B
TypeScript
import type { GrpcRequest } from '@yaakapp-internal/models';
|
|
import { atom, useAtomValue } from 'jotai';
|
|
import { jotaiStore } from '../lib/jotai';
|
|
|
|
export const grpcRequestsAtom = atom<GrpcRequest[]>([]);
|
|
|
|
export function useGrpcRequests() {
|
|
return useAtomValue(grpcRequestsAtom);
|
|
}
|
|
|
|
export function getGrpcRequest(id: string) {
|
|
return jotaiStore.get(grpcRequestsAtom).find((r) => r.id === id) ?? null;
|
|
}
|