Rx.Observable.generateWithRelativeTime(initialState, condition, iterate, resultSelector, timeSelector, [scheduler])

Generates an observable sequence by iterating a state from an initial state until the condition fails.


  1. initialState (Any): Initial state.
  2. condition (Function): Condition to terminate generation (upon returning false).
  3. iterate (Function): Iteration step function.
  4. resultSelector (Function): Selector function for results produced in the sequence.
  5. timeSelector (Function): Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
  6. [scheduler=Rx.Scheduler.timeout] (Scheduler): Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.timeout.


(Observable): The generated sequence.