Transformations allow you to create new observable streams by combining, filtering, or transforming the events emitted by other observable streams. The available transformations include the following:
- map: This transforms each event in a stream into another value before any observer can observe that value. For example, you could map the text property of a UISearchBar into an URL to be used to query some remote service.
- flatMap: This transforms each event into another Observable. For example, you could map the text property of a UISearchBar into the result of an asynchronous query.
- scan: This is similar to the reduce Swift operator on sequences. It will accumulate each new event into a partial result based on all previously emitted events and emit that result.
- filter: This enables filtering of emitted events based on a condition to be verified.
- merge: This merges two streams of events by preserving their ordering.
- zip: This combines two streams of events by creating a new stream whose events are tuples made by the successive events from the two original streams.