Sha256: 2458738ff0cad3ce2d7080ecd739f63ca6d34821868bbf16c6bdda2c2d7eb344

Contents?: true

Size: 1.36 KB

Versions: 49

Compression:

Stored size: 1.36 KB

Contents

/** PURE_IMPORTS_START .._operators_max PURE_IMPORTS_END */
import { max as higherOrderMax } from '../operators/max';
/**
 * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
 * and when source Observable completes it emits a single item: the item with the largest value.
 *
 * <img src="./img/max.png" width="100%">
 *
 * @example <caption>Get the maximal value of a series of numbers</caption>
 * Rx.Observable.of(5, 4, 7, 2, 8)
 *   .max()
 *   .subscribe(x => console.log(x)); // -> 8
 *
 * @example <caption>Use a comparer function to get the maximal item</caption>
 * interface Person {
 *   age: number,
 *   name: string
 * }
 * Observable.of<Person>({age: 7, name: 'Foo'},
 *                       {age: 5, name: 'Bar'},
 *                       {age: 9, name: 'Beer'})
 *           .max<Person>((a: Person, b: Person) => a.age < b.age ? -1 : 1)
 *           .subscribe((x: Person) => console.log(x.name)); // -> 'Beer'
 * }
 *
 * @see {@link min}
 *
 * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
 * value of two items.
 * @return {Observable} An Observable that emits item with the largest value.
 * @method max
 * @owner Observable
 */
export function max(comparer) {
    return higherOrderMax(comparer)(this);
}
//# sourceMappingURL=max.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
ilog-0.4.1 node_modules/rxjs/_esm5/operator/max.js
ilog-0.4.0 node_modules/rxjs/_esm5/operator/max.js
ilog-0.3.3 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-18.0.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.21.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.20.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.19.1 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.19.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.18.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.17.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.16.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.15.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.14.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.13.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.12.2 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.12.1 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.12.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.11.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.10.0 node_modules/rxjs/_esm5/operator/max.js
govuk_publishing_components-17.9.0 node_modules/rxjs/_esm5/operator/max.js