Operators construction

create

When you are starting out or you just want to test something you tend to start out with the create() operator. This takes a function with an observer as a parameter. This has been mentioned in previous sections such as Observable Wrapping. The siignature looks like the following

  1. Rx.Observable.create([fn])

And an example looks like:

  1. Rx.Observable.create(observer => {
  2. observer.next( 1 );
  3. })

range

Signature

  1. Rx.Observable.range([start],[count])

Example

  1. let stream$ = Rx.Observable.range(1,3)
  2. // emits 1,2,3