---
title: "init(upstream:isIncluded:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/publishers/filter/init(upstream:isincluded:)"
---

# init(upstream:isIncluded:)

Creates a publisher that republishes all elements that match a provided closure.

## Declaration

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

## Parameters

- `upstream`: The publisher from which this publisher receives elements.
- `isIncluded`: A closure that indicates whether to republish an element.
