File

libs/ngx-pfe/pfe-actions/update-state-on-backend/update-state-on-backend.service.ts

Index

Properties

Constructor

constructor(pfeStateService: PfeStateService)
Parameters :
Name Type Optional
pfeStateService PfeStateService No

Properties

Public executeActionUpdateStateOnBackend
Default value : () => {...}
import { Injectable } 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 {
  constructor(protected pfeStateService: PfeStateService) {}

  public executeActionUpdateStateOnBackend = async (actionConfig: PfeUpdateStateOnBackendActionConfig) => {
    if (actionConfig.pageToReturnTo) {
      this.pfeStateService.storeValue(LAST_VISITED_PAGE_STATE_KEY, actionConfig.pageToReturnTo);
    }
    await this.pfeStateService.storeState();
  };
}

results matching ""

    No results matching ""