RxJS is very convenient to use because it provides lot of operators. RxJS operators are very helpful in working with asynchronous data.
RxJS operators are actually functions. There are two types of operators:
Pipeable Operators
Creation operators
2. Pipeable Operators
These operators can be piped to Observables. The syntax of pipeable operator is:
observableInstance.pipe(operator())
Following are important points about pipeable operators:
A pipeable operator is a function that takes an Observable as its input and produces an Observable.
A pipeable operator does not change existing Observable.
A pipeable operator returns a new Observable whose subscription logic is based on first Observable.
Subscribing to the Observable returned by pipeable operator will also subscribe to the input Observable.
Due to above mentioned points, a pipeable operator is essentially a pure function.
filter() is an example of Pipeable operator.
3. Creation Operators
A creator operator is a function used to create a new Observable. A creator operator can create an Observable with some predefined behavior or by joining observables.
An example of a creation operator is interval function. It takes a number as an input argument and produces an Observable as output.