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

# init(upstream:transform:)

Creates a publisher that transforms all elements from the upstream publisher with a provided closure.

## Declaration

```swift
init(upstream: Upstream, transform: @escaping (Upstream.Output) -> Output)
```

## Parameters

- `upstream`: The publisher from which this publisher receives elements.
- `transform`: The closure that transforms elements from the upstream publisher.
