---
title: Publishers.Zip
framework: combine
role: symbol
role_heading: Structure
path: combine/publishers/zip
---

# Publishers.Zip

A publisher created by applying the zip function to two upstream publishers.

## Declaration

```swift
struct Zip<A, B> where A : Publisher, B : Publisher, A.Failure == B.Failure
```

## Overview

Overview Use Publishers.Zip to combine the latest elements from two publishers and emit a tuple to the downstream. The returned publisher waits until both publishers have emitted an event, then delivers the oldest unconsumed event from each publisher together as a tuple to the subscriber. Much like a zipper or zip fastener on a piece of clothing pulls together rows of teeth to link the two sides, Publishers.Zip combines streams from two different publishers by linking pairs of elements from each side. If either upstream publisher finishes successfully or fails with an error, so too does the zipped publisher.

## Topics

### Creating a zip publisher

- [init(_:_:)](combine/publishers/zip/init(_:_:).md)

### Declaring supporting types

- [Publishers.Zip.Output](combine/publishers/zip/output.md)
- [Publishers.Zip.Failure](combine/publishers/zip/failure.md)

### Inspecting publisher properties

- [a](combine/publishers/zip/a.md)
- [b](combine/publishers/zip/b.md)

### Comparing publishers

- [==(_:_:)](combine/publishers/zip/==(_:_:).md)

### Default Implementations

- [Equatable Implementations](combine/publishers/zip/equatable-implementations.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Publisher](combine/publisher.md)

## See Also

### Combining elements from multiple publishers

- [Publishers.CombineLatest](combine/publishers/combinelatest.md)
- [Publishers.CombineLatest3](combine/publishers/combinelatest3.md)
- [Publishers.CombineLatest4](combine/publishers/combinelatest4.md)
- [Publishers.Merge](combine/publishers/merge.md)
- [Publishers.Merge3](combine/publishers/merge3.md)
- [Publishers.Merge4](combine/publishers/merge4.md)
- [Publishers.Merge5](combine/publishers/merge5.md)
- [Publishers.Merge6](combine/publishers/merge6.md)
- [Publishers.Merge7](combine/publishers/merge7.md)
- [Publishers.Merge8](combine/publishers/merge8.md)
- [Publishers.MergeMany](combine/publishers/mergemany.md)
- [Publishers.Zip3](combine/publishers/zip3.md)
- [Publishers.Zip4](combine/publishers/zip4.md)
