libs/ngx-pfe/pfe-actions/update-state-on-backend/update-state-on-backend.service.ts
Properties |
Public executeActionUpdateStateOnBackend |
Default value : () => {...}
|
import { Injectable, inject } from '@angular/core';
import { LAST_VISITED_PAGE_STATE_KEY } from './../../services/pfe-navigation-service/navigation-util.service';
import { PfeStateService } from './../../services/pfe-state-service/state.service';
import { PfeUpdateStateOnBackendActionConfig } from './update-state-on-backend.model';
@Injectable()
export class PfeUpdateStateOnBackendService {
protected pfeStateService = inject(PfeStateService);
public executeActionUpdateStateOnBackend = async (actionConfig: PfeUpdateStateOnBackendActionConfig) => {
if (actionConfig.pageToReturnTo) {
this.pfeStateService.storeValue(LAST_VISITED_PAGE_STATE_KEY, actionConfig.pageToReturnTo);
}
await this.pfeStateService.storeState();
};
}