How to use the @igo2/common.EntityStoreWatcher function in @igo2/common

To help you get started, we’ve selected a few @igo2/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / catalog / catalog-browser / catalog-browser.component.ts View on Github external
ngOnInit() {
    const currentItems = this.map.layers.map((layer: Layer) => {
      return {
        id: layer.options.source.id,
        title: layer.title,
        type: CatalogItemType.Layer
      };
    });
    this.store.state.updateMany(currentItems, { added: true }, true);
    if (this.catalog && this.catalog.sortDirection !== undefined) {
      this.store.view.sort({
        direction: this.catalog.sortDirection,
        valueAccessor: (item: CatalogItem) => item.title
      });
    }
    this.watcher = new EntityStoreWatcher(this.store, this.cdRef);

  }