Skip to content

Documentation Format

richardszalay edited this page May 20, 2011 · 9 revisions

Documentation for all reactive operators (methods that involve raix.reactive.IObservable) contain the following sections.

Summary

Gives a one line overview, the signature of the method and a description of any arguments that are not self explanatory (like the expected method signatures of any Function arguments).

Unless otherwise specified, operators with a static method signatures are static methods of the raix.reactive.Observable class; operators with an instance method signature are method of the raix.reactive.IObservable interface.

Generics Syntax

The documentation often uses generics syntax (like Vector.<*>). This syntax is not supported by ActionScript; it is only used to describe a class with more detail.

IObservable.<int> refers to an IObservable the emits values of type int (though this is not enforced), meaning that values sent to an IObserver’s onNext method will be of class int.

Array.<int> refers to an array of int values.

The “source” of a sequence

Many operators refer to it’s “source”, and even the “sourceValueClass”. These operators are always instance methods of IObservable, and source refers to the IObservable instance the method was called on.

For example, given Observable.range(1, 3).take(2), the “source” of take is range and the “sourceValueClass” is int because that’s what range returns.

Remarks

Provides an overview of how the operator works, including situations that will cause it to complete or error.

Marble Diagrams

Marble diagrams is a way of visually representing reactive (asynchronous) data streams. To my knowledge, it was invented by the Rx team at Microsoft.

For more information on how to read marble diagrams, see Marble Diagrams.

Scheduler

If the operator uses a scheduler, this section describes what it is used for and which scheduler is used by default.

If you are new to the framework you can ignore them; all operators that use schedulers accept them as optional arguments and will use a default.

For more information on the subject, see Schedulers

Return Value

Describes the return value, usually in the “generic” format IObservable.<type> where type is the type of values that the observable will send to onNext.

Examples

One or more example uses of the operator. Some examples are real life scenarios, but most try to only use the more common (and less complex) operators in order to keep things simple.