Version: 0.0.20.0.30.0.40.0.50.0.60.0.70.0.80.0.90.0.100.0.110.0.120.1.00.1.10.1.20.1.30.1.40.1.50.1.60.1.70.1.80.1.90.1.100.2.00.2.10.2.20.2.30.2.40.2.50.2.60.2.70.2.80.3.00.3.10.3.20.3.30.3.40.3.50.3.60.3.70.3.80.3.90.3.100.3.110.3.120.3.130.3.140.3.150.4.00.4.10.4.20.4.50.4.60.4.70.4.80.4.90.4.100.5.00.5.10.6.00.6.10.6.20.6.30.6.40.6.50.6.60.6.70.6.80.6.90.6.100.6.110.6.120.6.130.6.140.6.150.6.160.6.170.6.180.6.190.6.200.6.210.6.220.7.0-experimental-10.7.0-experimental-20.7.0-rc10.7.0-rc20.7.0-rc30.7.0-rc40.7.0-rc50.7.0-rc60.7.0-rc80.7.0-rc90.7.00.7.10.7.20.7.30.7.40.7.5-alpha-10.7.50.7.60.7.70.7.80.7.90.7.100.7.110.7.120.7.130.7.140.7.150.7.160.7.170.7.180.7.190.7.200.7.210.7.220.7.230.7.240.7.250.7.260.7.270.7.280.7.290.7.300.7.310.7.320.7.330.7.340.7.350.7.360.7.370.7.380.7.390.7.400.7.410.7.420.7.430.7.440.7.450.7.460.7.470.7.480.7.490.7.500.7.510.7.520.7.530.7.540.7.550.7.560.7.570.7.580.7.590.7.600.7.610.7.620.7.630.7.640.7.650.7.660.7.670.7.680.7.690.7.700.7.710.7.720.7.730.7.740.7.750.7.760.7.770.7.780.7.790.7.800.7.810.7.820.7.830.7.840.7.850.7.860.7.870.7.880.7.890.7.900.7.910.7.920.7.930.7.940.7.951.0.01.0.12.0.02.0.12.0.22.0.32.0.42.0.52.0.62.0.72.0.82.0.92.0.102.0.112.0.122.0.133.0.03.0.13.0.23.0.33.0.43.0.53.0.63.0.73.0.83.0.93.0.103.0.113.0.123.0.133.0.143.0.153.0.163.0.173.0.183.0.19
import { EventStream } from "./observable";
import Observable from "./observable";
/**
Calls generator function which is expected to return an observable. The returned EventStream contains
values and errors from the spawned observable. When the spawned observable ends, the generator is called
again to spawn a new observable.
This is repeated until the generator returns a falsy value
(such as `undefined` or `false`).
The generator function is called with one argument — iteration number starting from `0`.
Here's an example:
```js
Bacon.repeat(function(i) {
if (i < 3) {
return Bacon.once(i);
} else {
return false;
}
}).log()
```
The example will produce values 0, 1 and 2.
@param {(number) => (Observable<V> | null)} generator
@returns {EventStream<V>}
@typeparam V Type of stream elements
*/
export default function repeat<V>(generator: (iteration: number) => (Observable<V> | undefined)): EventStream<V>;