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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software