Delving into Combine components
Until now, we have created simple examples in Combine to warm up. However, if we want to use Combine in a more advanced way, we need to understand better what happens under the hood.
The first thing we must understand is that Combine is not magic. Combine alone doesn’t include any sophisticated code. Ultimately, we are talking about a group of protocols that helps us subscribe to changes and create a pipeline of updates.
To delve in, we will review the different protocols and build our own custom publishers, operators, and subscribers to understand how things work inside.
Let’s start with the publisher.
Creating a custom publisher
I just mentioned that Combine is a set of protocols that speak with each other, and the publisher is the first protocol we will review.
Let’s see what we know up until now about the publisher:
- The publisher emits values to one or more subscribers
- The publisher output type must...