In this episode of[Combine Essentials, we take a look at two of Combine's most commonly used operators, map and compactMap.
Combine's filter and compactMap operators share a few similarities and it is possible to use them interchangeably in some scenarios. That said, there are a number of key differences we discuss in today's episode of Combine Essentials.
This episode of Combine Essentials zooms in on Combine's merge operator. As the name suggests, the merge operator merges two or more upstream publishers into a single publisher. Even though the merge operator isn't difficult to use, there are a few pitfalls to watch out for.
In an earlier installment of Combine Essentials, you learned about Combine's map operator, one of the most commonly used operators. The map operator has one important limitation. The closure you pass to the map operator can't be throwing. Don't worry, though. Combine's tryMap operator addresses this shortcoming.
Every Combine publisher defines two associated types, the Output type defines the type of elements the publisher can emit and the Failure type defines the type of errors the publisher can emit. The fact that a publisher is required to define an Output type and a Failure type is convenient, but it can sometimes be inconvenient.
What I love most about RxSwift is RxCocoa. RxCocoa defines a wide range of integrations with UIKit and AppKit. It is surprising that Apple's Combine framework lacks these integrations. The good news is that most of the integrations RxCocoa defines are easy to implement using Combine. In this episode, I show you how to observe the value of a UITextField instance using the Combine framework.
The Combine framework defines a number of operators to combine two or more publishers into a single publisher. Each of these operators serves a specific purpose. In this episode, I show you how to use the zip operator to combine publishers.