Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 684 Bytes

operators-construction.md

File metadata and controls

39 lines (25 loc) · 684 Bytes

#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

Observable.create([fn])

And an example looks like:

import { Observable } from 'rxjs';

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

range

Signature

import { range } from 'rxjs';

range([start],[count])

Example

import { range } from 'rxjs';


let stream$ = range(1,3)

// emits 1,2,3