mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-08-24 22:58:53 +08:00
Add support for Prometheus integration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
// usePolling repeatedly calls doFn with a fix time delay specified
|
||||
// by interval (in millisecond).
|
||||
@@ -9,3 +10,9 @@ export function usePolling(doFn: () => void, interval: number) {
|
||||
return () => clearInterval(id);
|
||||
}, [interval, doFn]);
|
||||
}
|
||||
|
||||
// useQuery gets the URL search params from the current URL.
|
||||
export function useQuery(): URLSearchParams {
|
||||
const { search } = useLocation();
|
||||
return useMemo(() => new URLSearchParams(search), [search]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user