Skip to content

Commit

Permalink
refactor(debounceRandom): Remove extraneous function wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Oct 31, 2020
1 parent 5bc00f8 commit b6df7ef
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/operators/debounceRandom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@ import {rng} from '../internal/rng';
* // Works like debounceTime, but debounces by anywhere between 100 and 200ms every time
*/
export function debounceRandom<T>(lower: number, upper: number): MonoTypeOperatorFunction<T> {
return source => source.pipe(
switchMap((value: T): Observable<T> => {
return timer(rng(lower, upper)).pipe(mapTo(value));
})
);
return switchMap((value: T): Observable<T> => timer(rng(lower, upper)).pipe(mapTo(value)));
}

0 comments on commit b6df7ef

Please sign in to comment.