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

# init(upstream:isIncluded:)

Creates a publisher that republishes all elements that match a provided error-throwing closure.

## Declaration

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

## Parameters

- `upstream`: The publisher from which this publisher receives elements.
- `isIncluded`: An error-throwing closure that indicates whether this filter should republish an element.
