A visual cheat sheet of Combine operators
A diagram-based reference for common Combine publisher operators.
26 Jan 2026 · 5 min read
This article provides a visual cheat sheet of common Combine operators, with a diagram for each one to illustrate how values flow through a pipeline. The diagrams focus on the most commonly used operators.

Note: The diagrams below are generated using SwiftUI. If you're interested in how they are built, you can find the source code on GitHub.
allSatisfy(_:)
Publishes true if all elements match the condition. Publishes false & completes if it receives an element that does not match the condition.

append(_:)
Appends the specified elements after the upstream publisher completes.

collect(_:)
Collects up to the specified number of elements and emits them in an array.

combineLatest(_:)
Publishes a tuple of the most recent element from multiple publishers when any of them emits a value.

compactMap(_:)
Transforms each element with the provided closure and publishes any returned non-nil optional result.

contains(_:)
Publishes true & completes after receiving a matching value, or false when upstream publisher completes without producing a matching value.

count()
Publishes the count of all received elements when the upstream publisher completes.

dropFirst(_:)
Omits a specified number of elements, then republishes all remaining elements.

drop(while:)
Omits elements until a given closure returns false, then republishes all remaining elements.

filter(_:)
Republishes all elements that match a provided closure.

first()
Publishes the first element of the upstream publisher, then completes.

first(where:)
Publishes the first element of a stream that satisfies a condition, then completes.

flatMap(maxPublishers:_:)
Transforms all elements from an upstream publisher into a new publisher.

ignoreOutput()
Ignores all elements and passes along only the upstream publisher's completion state.

last()
Publishes the last element of the upstream publisher after it completes.

last(where:)
Publishes the last element that satisfies a condition after the upstream publisher completes.

map(_:)
Transforms each element it receives from the upstream publisher with the provided closure.

max()
Publishes the maximum value received after the upstream publisher completes.

merge(with:)
Publishes an element whenever any of the upstream publishers emits an element.

min()
Publishes the minimum value received after the upstream publisher completes.

output(at:)
Republishes an element specified by its position, or completes if upstream publisher completes before the specified element.

output(in:)
Republishes elements specified by a range of positions.

prefix(_:)
Republishes elements up to a specified maximum count.

prefix(while:)
Emits values while elements meet the specified condition, otherwise it completes.

prepend(_:)
Prepends elements with the specified values.

reduce(_:_:)
Applies a closure to all elements and publishes a final result when the upstream publisher completes.

removeDuplicates()
Publishes an element only if it doesn't match the previous element.

replaceNil(with:)
Replaces nil elements with the provided element.

scan(_:_:)
Transforms elements by applying a closure that receives its previous return value and the next element from the upstream publisher.

switchToLatest()
Republishes elements sent by the most recently received publisher.

zip(_:)
Waits until both publishers emit an element, then publishes the oldest unconsumed element from each one as a tuple.




Newsletter
Like to support my work?
Say hi
Related tags
Articles with related topics
Latest articles and tips



