diff --git a/client/src/components/History/providers/HistoryContentProvider/loadContents.js b/client/src/components/History/providers/HistoryContentProvider/loadContents.js index 43e99a457f2..6fa25efe372 100644 --- a/client/src/components/History/providers/HistoryContentProvider/loadContents.js +++ b/client/src/components/History/providers/HistoryContentProvider/loadContents.js @@ -6,11 +6,11 @@ import { loadHistoryContents } from "../../caching"; // prettier-ignore export const loadContents = (cfg = {}) => { - const { - windowSize, - initialInterval = 2 * 1000, - maxInterval = 10 * initialInterval, - disablePoll = false + const { + windowSize, + initialInterval = 2 * 1000, + maxInterval = 10 * initialInterval, + disablePoll = false } = cfg; return switchMap(([{ id }, params, hid]) => { diff --git a/client/src/utils/observable/decay.js b/client/src/utils/observable/decay.js index b1ec4a94802..099d90b1512 100644 --- a/client/src/utils/observable/decay.js +++ b/client/src/utils/observable/decay.js @@ -2,28 +2,19 @@ import { of } from "rxjs"; import { mergeMap, delay } from "rxjs/operators"; -let decayCounter = 0; - -// prettier-ignore export const decay = (cfg = {}) => { - const { - initialInterval, - maxInterval = 60 * 1000, - lambda = 0.25 - } = cfg; + const { initialInterval, maxInterval = 60 * 1000, lambda = 0.25 } = cfg; if (undefined === initialInterval) { throw new Error("provide an initialInterval to decay"); } let counter = 0; - decayCounter++; - return mergeMap(val => { + return mergeMap((val) => { let waitTime = Math.floor(initialInterval * Math.exp(lambda * counter++)); waitTime = Math.max(waitTime, initialInterval); waitTime = Math.min(waitTime, maxInterval); - console.log("decay time", decayCounter, waitTime); - return of(val).pipe(delay(waitTime)) + return of(val).pipe(delay(waitTime)); }); -} +}; diff --git a/client/src/utils/observable/monitorXHR.js b/client/src/utils/observable/monitorXHR.js index 74c2128ed6a..7c9ea274c45 100644 --- a/client/src/utils/observable/monitorXHR.js +++ b/client/src/utils/observable/monitorXHR.js @@ -2,7 +2,6 @@ import { defer, Subject } from "rxjs"; import { filter, finalize, share } from "rxjs/operators"; // global XHR request feed, emits every time xhr fires -// prettier-ignore const xhr$ = defer(() => { const request$ = new Subject(); @@ -19,12 +18,10 @@ const xhr$ = defer(() => { XMLHttpRequest.prototype.open = originalOpen; }) ); -}).pipe( - share() -); +}).pipe(share()); /** - * Watch outgong ajax calls for any of the indicated methods, filter to any of the provided route regexes + * Watch outgoing ajax calls for any of the indicated methods, filter to any of the provided route regexes * * @param {Object} cfg Configure methods and routes to monitor * @return {Observable} Observable that emits every time a matching outgoing request happens