Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private loadCatalogItems(catalog: Catalog) {
let store = this.catalogState.getCatalogItemsStore(catalog);
if (store !== undefined) {
this.store$.next(store);
return;
}
store = new EntityStore([]);
this.catalogState.setCatalogItemsStore(catalog, store);
this.catalogService
.loadCatalogItems(catalog)
.subscribe((items: CatalogItem[]) => {
store.load(items);
this.store$.next(store);
});
}
}