Skip to content
richardszalay edited this page May 20, 2011 · 9 revisions

Creates a sequence of integers starting at start and incrementing for count values (including start).

static function range(start : int, count : uint, scheduler : IScheduler = null)

Remarks

The returned sequence completes after count values

The returned sequence does not error

Marble Diagrams

────o──────────o──────────o────────────────o──/
  start     start+1    start+2  ...   start+count─1

Scheduling

Unless specified, this operator uses Scheduler.synchronous.

Return Value

IObservable.<int>

Examples

Observable.range(0, 4)
    .subscribe(
        function(value:int) : void { trace(value); },
        function():void { trace("Completed!"); }
     );

    // Trace output is:
    // 0
    // 1
    // 2
    // 3
    // 4
    // Completed!
Clone this wiki locally