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

# init(upstream:output:)

Creates a publisher that replaces an empty stream with a provided element.

## Declaration

```swift
init(upstream: Upstream, output: Publishers.ReplaceEmpty<Upstream>.Output)
```

## Parameters

- `upstream`: The element to deliver when the upstream publisher finishes without delivering any elements.
- `output`: The publisher from which this publisher receives elements.
