Instance Method

tryFilter(_:)

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

Declaration

func tryFilter(_ isIncluded: @escaping ((Output0, Output1)) throws -> Bool) -> Publishers.TryFilter<Publishers.MapKeyPath2<Upstream, Output0, Output1>>

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.