Instance Method

tryFilter(_:)

Republishes all elements that match a provided error-throwing closure.

Declaration

func tryFilter(_ isIncluded: @escaping (Upstream.Output) throws -> Bool) -> Publishers.TryFilter<Publishers.Share<Upstream>>

Parameters

isIncluded

A closure that takes one element and returns a Boolean value indicating whether to republish the element.

Return Value

A publisher that republishes all elements that satisfy the closure.

Discussion

If the isIncluded closure throws an error, the publisher fails with that error.