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.

dematerialize.d.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Notification } from '../Notification';
  2. import { OperatorFunction } from '../types';
  3. /**
  4. * Converts an Observable of {@link Notification} objects into the emissions
  5. * that they represent.
  6. *
  7. * <span class="informal">Unwraps {@link Notification} objects as actual `next`,
  8. * `error` and `complete` emissions. The opposite of {@link materialize}.</span>
  9. *
  10. * ![](dematerialize.png)
  11. *
  12. * `dematerialize` is assumed to operate an Observable that only emits
  13. * {@link Notification} objects as `next` emissions, and does not emit any
  14. * `error`. Such Observable is the output of a `materialize` operation. Those
  15. * notifications are then unwrapped using the metadata they contain, and emitted
  16. * as `next`, `error`, and `complete` on the output Observable.
  17. *
  18. * Use this operator in conjunction with {@link materialize}.
  19. *
  20. * ## Example
  21. * Convert an Observable of Notifications to an actual Observable
  22. * ```javascript
  23. * const notifA = new Notification('N', 'A');
  24. * const notifB = new Notification('N', 'B');
  25. * const notifE = new Notification('E', undefined,
  26. * new TypeError('x.toUpperCase is not a function')
  27. * );
  28. * const materialized = of(notifA, notifB, notifE);
  29. * const upperCase = materialized.pipe(dematerialize());
  30. * upperCase.subscribe(x => console.log(x), e => console.error(e));
  31. *
  32. * // Results in:
  33. * // A
  34. * // B
  35. * // TypeError: x.toUpperCase is not a function
  36. * ```
  37. *
  38. * @see {@link Notification}
  39. * @see {@link materialize}
  40. *
  41. * @return {Observable} An Observable that emits items and notifications
  42. * embedded in Notification objects emitted by the source Observable.
  43. * @method dematerialize
  44. * @owner Observable
  45. */
  46. export declare function dematerialize<T>(): OperatorFunction<Notification<T>, T>;