Handling the Operators
Learn how to transform sequences through operators.
We'll cover the following
In RxJS, methods that transform or query sequences are called operators. Operators are found in the static Rx.Observable
object and in Observable instances. In our example, create
is one such operator.
The create
operator is a good choice for when we have to create a very specific Observable, but RxJS provides plenty of other operators that make it easy to create Observables for common sources.
Let’s look again at our previous example. For a common operation such as an Ajax request, there is often an operator ready for us to use. In this case, the RxJS DOM library provides several ways to create Observables from DOM-related sources. Since we’re carrying out a GET
request, we can use Rx.DOM.get
and our code will become this:
Get hands-on with 1200+ tech skills courses.