How to use the @datorama/akita.EntityDirtyCheckPlugin function in @datorama/akita

To help you get started, we’ve selected a few @datorama/akita 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 datorama / akita / angular / playground / src / app / widgets / widgets.component.ts View on Github external
ngOnInit() {
    if (this.widgetsQuery.hasEntity() === false) {
      this.widgetService.initWidgets();
    }
    this.dashoboardName$ = this.widgetsQuery.select(state => state.name);
    this.widgets$ = this.widgetsQuery.selectAll();
    this.activeWidgets$ = this.widgetsQuery.selectActive();
    this.collection = new DirtyCheckPlugin(this.widgetsQuery, {
      watchProperty: 'entities'
    }).setHead();
    this.widgetsSpecific = new EntityDirtyCheckPlugin(
      this.widgetsQuery
    ).setHead();
  }