Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

toArray.d.ts 932B

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. * ```ts
  15. * import { interval } from 'rxjs';
  16. * import { toArray, take } from 'rxjs/operators';
  17. *
  18. * const source = interval(1000);
  19. * const example = source.pipe(
  20. * take(10),
  21. * toArray()
  22. * );
  23. *
  24. * const subscribe = example.subscribe(val => console.log(val));
  25. *
  26. * // output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  27. *
  28. * ```
  29. * @return An array from an observable sequence.
  30. * @method toArray
  31. * @owner Observable
  32. */
  33. export declare function toArray<T>(): OperatorFunction<T, T[]>;