useK8sWatchResources

Hook that retrieves the k8s resources along with their respective status for loaded and error. It returns a map where keys are as provided in initResources and value has three properties data, loaded and error.

Example

const Component: React.FC = () => {
  const watchResources = {
        'deployment': {...},
        'pod': {...}
        ...
      }
  const {deployment, pod} = useK8sWatchResources(watchResources)
  return ...
}
Parameter Name Description

initResources

Resources must be watched as key-value pair, wherein key is unique to resource and value is options needed to watch for that resource.