Skip to content

Commit

Permalink
Merge pull request #4990 from rawagner/watch_k8s_type
Browse files Browse the repository at this point in the history
Extract and export object type of watch k8s resources result
  • Loading branch information
openshift-merge-robot committed Apr 10, 2020
2 parents e57639c + 56d1f8e commit f4c4050
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/public/components/utils/k8s-watch-hook.ts
Expand Up @@ -227,8 +227,14 @@ export type ResourcesObject = { [key: string]: K8sResourceCommon | K8sResourceCo

type WatchK8sResult<R extends K8sResourceCommon | K8sResourceCommon[]> = [R, boolean, any];

export type WatchK8sResultsObject<R extends K8sResourceCommon | K8sResourceCommon[]> = {
data: R;
loaded: boolean;
loadError: any;
};

export type WatchK8sResults<R extends ResourcesObject> = {
[k in keyof R]: { data: R[k]; loaded: boolean; loadError: any };
[k in keyof R]: WatchK8sResultsObject<R[k]>;
};

export type WatchK8sResources<R extends ResourcesObject> = {
Expand Down

0 comments on commit f4c4050

Please sign in to comment.