7type KubeCoalesceStore = { resourcesA: KubeResource[] } 9export const kubeCoalesceCtx = genContext<KubeCoalesceStore>() 11export const getReqKubeCoalesceCtx = (): KubeCoalesceStore => { 12 const store = kubeCoalesceCtx.getStore() 17export const wrapKubeCoalesce = async <T,>(fnc: (props: any) => Promise<T>, props?: Record<string, unknown>): Promise<T> => { 18 if (!kubeCoalesceCtx.getStore()) { 19 const resourcesA: KubeResource[] = [] 20 kubeCoalesceCtx.enterWith({resourcesA}) // ctx:clear 22 const ret = await fnc(props) 24 const actionFnc = (coalActions as unknown as Record<string, (() => void | Promise<void>) | undefined>)[action as string]