import { DataFetcher } from "../DataFetcher";
export class ServiceBrokerRecaller {
  constructor(serviceName, requestBody, successCallback, errorCallback) {
    this.serviceName = serviceName;
    this.requestBody = requestBody;
    this.successCallback = successCallback;
    this.errorCallback = errorCallback;
  }
  reCall(requestBody) {
    if (requestBody) {
      this.requestBody = requestBody;
    }
    return DataFetcher.get().callServiceBroker(this.serviceName, this.requestBody).then(this.successCallback, this.errorCallback);
  }
}
