Front end of the Slack clone application.

min.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. var min_1 = require('../operators/min');
  3. /**
  4. * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
  5. * and when source Observable completes it emits a single item: the item with the smallest value.
  6. *
  7. * <img src="./img/min.png" width="100%">
  8. *
  9. * @example <caption>Get the minimal value of a series of numbers</caption>
  10. * Rx.Observable.of(5, 4, 7, 2, 8)
  11. * .min()
  12. * .subscribe(x => console.log(x)); // -> 2
  13. *
  14. * @example <caption>Use a comparer function to get the minimal item</caption>
  15. * interface Person {
  16. * age: number,
  17. * name: string
  18. * }
  19. * Observable.of<Person>({age: 7, name: 'Foo'},
  20. * {age: 5, name: 'Bar'},
  21. * {age: 9, name: 'Beer'})
  22. * .min<Person>( (a: Person, b: Person) => a.age < b.age ? -1 : 1)
  23. * .subscribe((x: Person) => console.log(x.name)); // -> 'Bar'
  24. * }
  25. *
  26. * @see {@link max}
  27. *
  28. * @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
  29. * value of two items.
  30. * @return {Observable<R>} An Observable that emits item with the smallest value.
  31. * @method min
  32. * @owner Observable
  33. */
  34. function min(comparer) {
  35. return min_1.min(comparer)(this);
  36. }
  37. exports.min = min;
  38. //# sourceMappingURL=min.js.map