09e7ca9c8682d48fc44eab21ed3f6f731583bb1c3ad0ae62653795870de95f76ddb4df41a5177cbbfda69bf712738e974751c99cd7518b04e030559b9ae2f0 973 B

123456789101112131415161718192021222324252627282930313233
  1. import { OperatorFunction } from '../types';
  2. /**
  3. * Collects all source emissions and emits them as an array when the source completes.
  4. *
  5. * <span class="informal">Get all values inside an array when the source completes</span>
  6. *
  7. * ![](toArray.png)
  8. *
  9. * `toArray` will wait until the source Observable completes before emitting
  10. * the array containing all emissions. When the source Observable errors no
  11. * array will be emitted.
  12. *
  13. * ## Example
  14. *
  15. * ```ts
  16. * import { interval, take, toArray } from 'rxjs';
  17. *
  18. * const source = interval(1000);
  19. * const example = source.pipe(
  20. * take(10),
  21. * toArray()
  22. * );
  23. *
  24. * example.subscribe(value => console.log(value));
  25. *
  26. * // output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  27. * ```
  28. *
  29. * @return A function that returns an Observable that emits an array of items
  30. * emitted by the source Observable when source completes.
  31. */
  32. export declare function toArray<T>(): OperatorFunction<T, T[]>;
  33. //# sourceMappingURL=toArray.d.ts.map