lrucache fix
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2024-01-20 00:19:14 +02:00
parent a66f7f5fd8
commit 29cb9a61b4

View File

@ -12,7 +12,7 @@ const cache = new LRUCache<string, NostrEvent[]>({ maxSize: 100 });
export function useWorkerRelayView(id: string, filters: Array<ReqFilter>, leaveOpen?: boolean, maxWindow?: number) {
const cacheKey = useMemo(() => JSON.stringify(filters), [filters]);
const [events, setEvents] = useState<Array<NostrEvent>>(cache.get(cacheKey) ?? []);
const [events, setEvents] = useState<Array<NostrEvent>>(cache.get(cacheKey) || []);
const [rb, setRb] = useState<RequestBuilder>();
const system = useContext(SnortContext);