Skip to content

Latest commit

 

History

History
88 lines (54 loc) · 1.95 KB

BasicOperators.md

File metadata and controls

88 lines (54 loc) · 1.95 KB

Basic Operators

This document explains some of the most common operators used in ReactiveCocoa, and includes examples demonstrating their use. Note that operators in this context refer to functions that transform signals, not custom Swift operators. In other words, these are the composeable primitives provided by ReactiveCocoa for working with signals. Roughly speaking they take the shape of (Input..., Signal...) -> Signal.

Additionally, this document will use the term "signal" when dealing with concepts that apply to both Signal and SignalProducer. When the distinction matters the inline code-style will be used.

Performing side effects with signals

  1. Observation
  2. Injecting effects

Operator composition

  1. Lifting
  2. Pipe

Transforming signals

  1. Mapping
  2. Filtering
  3. Reducing

Combining signals

  1. Combining latest values
  2. Zipping

Flattening producers

  1. Concatenating
  2. Merging
  3. Switching

Handling errors

  1. Catching errors
  2. Mapping errors
  3. Retrying

Performing side effects with signals

Observation

Injecting effects

Operator composition

Lifting

Pipe

Transforming signals

Mapping

Filtering

Reducing

Combining signals

Combining latest values

Zipping

Flattening producers

Concatenating

Merging

Switching

Handling errors

Catching errors

Mapping errors

Retrying