a zip code crypto-currency system good for red ONLY

last.js 1.2KB

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