Combine

Overview

Combine is a framework for processing values over time.

Combine defines the protocols Publisher and Subscriber. Publishers deliver elements to subscribers and subscribers receive a stream of elements from a publisher.

TODO: See the free, online book Using Combine.

Publishers

map method

This method takes a closure that receives elements from a Publisher and transforms them in some way. It returns a new Publisher that publishes the transformed values.

tryMap method

This method is similar to the map method, but the closure is allowed to throw an error. If it does, publishing will stop.

There are many more try versions of Publisher methods. These include tryAllSatisify, tryCompactMap, tryContains, tryDrop, tryFilter, tryFirst, tryLast, tryMax, tryMin, tryPrefix, tryReduce, tryRemoveDuplicates, and tryScan methods.