This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var IS; | |
(function (IS) { | |
var HttpRequestLocker = (function () { | |
function HttpRequestLocker($http, $q, requestConfig, successCallback) { | |
this.$http = $http; | |
this.$q = $q; | |
this.requestConfig = requestConfig; | |
this.successCallback = successCallback; | |
} | |
HttpRequestLocker.prototype.execute = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, ReplaySubject } from 'rxjs'; | |
export function cacheable<T>(observable: Observable<T>): Observable<T> { | |
const replaySubject = new ReplaySubject<T>(1); | |
observable.subscribe(x => replaySubject.next(x), x => replaySubject.error(x), () => replaySubject.complete()); | |
return replaySubject.asObservable(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs'; | |
import { finalize, share } from 'rxjs/operators'; | |
export function ReusePendingObservable() { | |
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { | |
const originalMethod = descriptor.value; | |
const pendingObservablePropertyName = `__pendingObservable${propertyKey}`; | |
target[pendingObservablePropertyName] = null; | |
descriptor.value = function (...args: any[]) { |