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

Creates a sequence of type that returns value and immediately completes. Passing a value to the global [toObservable] function is a shorthand way of calling this method.

static function value(value : Object, 
    scheduler : IScheduler = null) : IObservable.<TValue>

Remarks

The returned sequence completes after emitting value

The returned sequence does not error

Marble Diagrams

  ─o/
 value

Scheduling

Unless specified, this operator uses Scheduler.defaultScheduler.

Return Value

IObservable.<TValue>

Examples

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

    // Trace output is:
    // 5
    // Completed!
Clone this wiki locally