libs/ngx-pfe/pfe-actions/trigger-service-activators/trigger-service-activators.service.ts
Properties |
Accessors |
Public executeActionTriggerServiceActivators |
Default value : () => {...}
|
serviceActivatorService | ||||||
setserviceActivatorService(service: PfeServiceActivatorService)
|
||||||
Parameters :
Returns :
void
|
import { Injectable } from '@angular/core';
import { PfeServiceActivatorService } from './../../pfe-service-activator/service/service-activator.service';
import { PfeTriggerServiceActivatorsActionConfig } from './trigger-service-activators.model';
@Injectable()
export class PfeTriggerServiceActivatorsService {
protected pfeServiceActivatorsService: PfeServiceActivatorService | undefined;
public set serviceActivatorService(service: PfeServiceActivatorService) {
this.pfeServiceActivatorsService = service;
}
public executeActionTriggerServiceActivators = async (actionConfig: PfeTriggerServiceActivatorsActionConfig): Promise<void> => {
if (!this.pfeServiceActivatorsService) {
throw new Error('serviceActivatorService not available');
} else {
await this.pfeServiceActivatorsService.spreadWithGlobalServiceActivatorConfig(actionConfig.serviceActivators);
await this.pfeServiceActivatorsService.handleServiceActivators(
actionConfig.serviceActivators,
actionConfig.executeServiceActivatorsSequential
);
return Promise.resolve();
}
};
}