7.5.2.29. useK8sWatchResources
检索 k8s 资源的 hook,以及它们的相应状态用于加载和错误。它返回一个映射,在 initResouces 中提供的键,值有三个属性 data, loaded 和 error。
Example
const Component: React.FC = () => {
const watchResources = {
'deployment': {...},
'pod': {...}
...
}
const {deployment, pod} = useK8sWatchResources(watchResources)
return ...
}
| 参数名称 | 描述 |
|---|---|
|
| 资源需要被监视为键值对,其中键对于资源是唯一的,值将是监视相应资源的选项。 |