fixes / responding to comments

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-01-11 15:10:11 +02:00
1 parent ddf45c2025
commit 62e0f575c7
4 files changed
+25 -38

No files matched your search

@@ -39,9 +39,7 @@ export class WorkloadsOverview extends React.Component<Props> {
isAllowedResource("events") && eventStore,
].filter(Boolean);
const unsubscribeMap = new Map<KubeObjectStore, Function>(
stores.map(store => [store, Function])
);
const unsubscribeMap = new Map<KubeObjectStore, () => void>();
const loadStores = async () => {
this.isLoading = true;
@@ -52,7 +50,7 @@ export class WorkloadsOverview extends React.Component<Props> {
try {
store.reset();
await store.loadAll();
unsubscribeMap.get(store)(); // unsubscribe previous watcher
unsubscribeMap.get(store)?.(); // unsubscribe previous watcher
unsubscribeMap.set(store, store.subscribe());
} catch (error) {
console.error("loading store error", error);