Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

single.d.ts 1.1KB

1234567891011121314151617181920
  1. import { Observable } from '../Observable';
  2. import { MonoTypeOperatorFunction } from '../types';
  3. /**
  4. * Returns an Observable that emits the single item emitted by the source Observable that matches a specified
  5. * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no
  6. * items, notify of an IllegalArgumentException or NoSuchElementException respectively. If the source Observable
  7. * emits items but none match the specified predicate then `undefined` is emiited.
  8. *
  9. * ![](single.png)
  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 - A predicate function to evaluate items emitted by the source Observable.
  14. * @return {Observable<T>} An Observable that emits the single item emitted by the source Observable that matches
  15. * the predicate or `undefined` when no items match.
  16. *
  17. * @method single
  18. * @owner Observable
  19. */
  20. export declare function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T>;