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.

repeat.d.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { MonoTypeOperatorFunction } from '../types';
  2. /**
  3. * Returns an Observable that will resubscribe to the source stream when the source stream completes, at most count times.
  4. *
  5. * <span class="informal">Repeats all values emitted on the source. It's like {@link retry}, but for non error cases.</span>
  6. *
  7. * ![](repeat.png)
  8. *
  9. * Similar to {@link retry}, this operator repeats the stream of items emitted by the source for non error cases.
  10. * Repeat can be useful for creating observables that are meant to have some repeated pattern or rhythm.
  11. *
  12. * Note: `repeat(0)` returns an empty observable and `repeat()` will repeat forever
  13. *
  14. * ## Example
  15. * Repeat a message stream
  16. * ```ts
  17. * import { of } from 'rxjs';
  18. * import { repeat, delay } from 'rxjs/operators';
  19. *
  20. * const source = of('Repeat message');
  21. * const example = source.pipe(repeat(3));
  22. * example.subscribe(x => console.log(x));
  23. *
  24. * // Results
  25. * // Repeat message
  26. * // Repeat message
  27. * // Repeat message
  28. * ```
  29. *
  30. * Repeat 3 values, 2 times
  31. * ```ts
  32. * import { interval } from 'rxjs';
  33. * import { repeat, take } from 'rxjs/operators';
  34. *
  35. * const source = interval(1000);
  36. * const example = source.pipe(take(3), repeat(2));
  37. * example.subscribe(x => console.log(x));
  38. *
  39. * // Results every second
  40. * // 0
  41. * // 1
  42. * // 2
  43. * // 0
  44. * // 1
  45. * // 2
  46. * ```
  47. *
  48. * @see {@link repeatWhen}
  49. * @see {@link retry}
  50. *
  51. * @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield
  52. * an empty Observable.
  53. * @return {Observable} An Observable that will resubscribe to the source stream when the source stream completes
  54. * , at most count times.
  55. * @method repeat
  56. * @owner Observable
  57. */
  58. export declare function repeat<T>(count?: number): MonoTypeOperatorFunction<T>;