File
queryStoreValue
|
Default value : () => {...}
|
|
Accessors
dataChanged$
|
getdataChanged$()
|
|
notify that some data in the store has changed
so we can invalidate the acl rules.
|
import { PfeStateService } from '@allianz/ngx-pfe';
import { ExpressionStoreAdapter } from '@allianz/taly-acl';
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class PfeAclExpressionAdapter implements ExpressionStoreAdapter {
private _dataChangedSubject = new Subject<void>();
constructor(private pfeStateService: PfeStateService) {
this.pfeStateService.pfeUserInputState$.subscribe(() => this.handleStateChanged());
}
queryStoreValue = (path: string) => {
const value = this.pfeStateService.getStateValueByExpression(path);
return value;
};
/**
* notify that some data in the store has changed
* so we can invalidate the acl rules.
*/
get dataChanged$() {
return this._dataChangedSubject.asObservable();
}
private handleStateChanged() {
this._dataChangedSubject.next();
}
}