In the first chapter's reactive sum example, we were filtering the user input, based on a special pattern. The pattern was, for example, a: <number>. It is common to filter only interesting bits of data from the data stream. For example, it's useful to filter out <enter> key-down events only from all key-down events, or only lines containing a given expression from a file. That's why it is important to not only be able to transform our data but also to learn how to filter it.
It shows that the
filter() operator filters the data by some property. In the diagram, it's the form of the elements: it filters only circles. Like all the other operators,
filter() creates a new
Observable instance from the source. This
Observable instance emits only items that comply to the condition, defined by the
filter() operator. The following...