import{Observable}from'rxjs';// Replaces use of RxJS delay. See v0.5.4./** adds specified delay (in ms) to both next and error channels of the response observable */exportfunctiondelayResponse(response$,delayMs){returnnewObservable(function(observer){varcompletePending=false;varnextPending=false;varsubscription=response$.subscribe(function(value){nextPending=true;setTimeout(function(){observer.next(value);if(completePending){observer.complete();}},delayMs);},function(error){returnsetTimeout(function(){returnobserver.error(error);},delayMs);},function(){completePending=true;if(!nextPending){observer.complete();}});returnfunction(){returnsubscription.unsubscribe();};});}//# sourceMappingURL=delay-response.js.map