mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
fix(k8s-services): avoid rerendering services table [r8s-387] (#832)
This commit is contained in:
parent
8d29b5ae71
commit
303047656e
9 changed files with 216 additions and 99 deletions
|
@ -8,9 +8,13 @@ import { PortainerNamespace } from '../types';
|
|||
|
||||
import { queryKeys } from './queryKeys';
|
||||
|
||||
export function useNamespacesQuery(
|
||||
export function useNamespacesQuery<T = PortainerNamespace[]>(
|
||||
environmentId: EnvironmentId,
|
||||
options?: { autoRefreshRate?: number; withResourceQuota?: boolean }
|
||||
options?: {
|
||||
autoRefreshRate?: number;
|
||||
withResourceQuota?: boolean;
|
||||
select?: (namespaces: PortainerNamespace[]) => T;
|
||||
}
|
||||
) {
|
||||
return useQuery(
|
||||
queryKeys.list(environmentId, {
|
||||
|
@ -22,6 +26,7 @@ export function useNamespacesQuery(
|
|||
refetchInterval() {
|
||||
return options?.autoRefreshRate ?? false;
|
||||
},
|
||||
select: options?.select,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue