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

# init(upstream:maxPublishers:transform:)

Creates a publisher that transforms elements from an upstream publisher into a new publisher.

## Declaration

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

## Parameters

- `upstream`: The publisher from which this publisher receives elements.
- `maxPublishers`: The maximum number of concurrent publisher subscriptions.
- `transform`: A closure that takes an element as a parameter and returns a publisher that produces elements of that type.
