How to create custom Publisher in Combine

How to create custom Publisher in Combine

If you are reading this article, I dare to assume that you’ve already tried Combine in your pet project. And you have some questions about this new and exciting Apple’s framework. For example how to create your publishers in Combine? This article can help you understand the basics of the mechanism of creating custom publishers for different needs.

[…]

Subscription is like Interactor, ViewModel or simply Brain of publisher-subscriber collaboration. The publisher creates a subscription with all required dependencies and gives it to the subscriber. After this, the subscription starts acting and processing values over time. Then subscriber consumes these values and we can receive them in the sink closure.

[…]