Front end of the Slack clone application.

last.js 1.2KB

12345678910111213141516171819202122232425
  1. /** PURE_IMPORTS_START .._operators_last PURE_IMPORTS_END */
  2. import { last as higherOrder } from '../operators/last';
  3. /* tslint:enable:max-line-length */
  4. /**
  5. * Returns an Observable that emits only the last item emitted by the source Observable.
  6. * It optionally takes a predicate function as a parameter, in which case, rather than emitting
  7. * the last item from the source Observable, the resulting Observable will emit the last item
  8. * from the source Observable that satisfies the predicate.
  9. *
  10. * <img src="./img/last.png" width="100%">
  11. *
  12. * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
  13. * callback if the Observable completes before any `next` notification was sent.
  14. * @param {function} predicate - The condition any source emitted item has to satisfy.
  15. * @return {Observable} An Observable that emits only the last item satisfying the given condition
  16. * from the source, or an NoSuchElementException if no such items are emitted.
  17. * @throws - Throws if no items that match the predicate are emitted by the source Observable.
  18. * @method last
  19. * @owner Observable
  20. */
  21. export function last(predicate, resultSelector, defaultValue) {
  22. return higherOrder(predicate, resultSelector, defaultValue)(this);
  23. }
  24. //# sourceMappingURL=last.js.map