1 import { MonoTypeOperatorFunction } from '../types';
3 * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
4 * and when source Observable completes it emits a single item: the item with the largest value.
9 * Get the maximal value of a series of numbers
11 * import { of } from 'rxjs';
12 * import { max } from 'rxjs/operators';
14 * of(5, 4, 7, 2, 8).pipe(
17 * .subscribe(x => console.log(x)); // -> 8
20 * Use a comparer function to get the maximal item
22 * import { of } from 'rxjs';
23 * import { max } from 'rxjs/operators';
30 * {age: 7, name: 'Foo'},
31 * {age: 5, name: 'Bar'},
32 * {age: 9, name: 'Beer'},
34 * max<Person>((a: Person, b: Person) => a.age < b.age ? -1 : 1),
36 * .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'
41 * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
43 * @return {Observable} An Observable that emits item with the largest value.
47 export declare function max<T>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction<T>;