---
title: "init(upstream:encoder:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/publishers/encode/init(upstream:encoder:)"
---

# init(upstream:encoder:)

Creates a publisher that decodes elements received from an upstream publisher, using a given decoder.

## Declaration

```swift
init(upstream: Upstream, encoder: Coder)
```

## Parameters

- `upstream`: The publisher from which this publisher receives elements.
- `encoder`: The encoder that decodes elements received from the upstream publisher.
