Instance Method

filter(_:)

Republishes all elements that match a provided closure.

Declaration

func filter(_ isIncluded: @escaping (Upstream.Output) -> Bool) -> Publishers.Filter<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.

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