Instance Method

prefix(while:)

Republishes elements while a predicate closure indicates publishing should continue.

Declaration

func prefix(while predicate: @escaping ((A.Output, B.Output)) -> Bool) -> Publishers.PrefixWhile<Publishers.CombineLatest<A, B>>

Parameters

predicate

A closure that takes an element as its parameter and returns a Boolean value indicating whether publishing should continue.

Return Value

A publisher that passes through elements until the predicate indicates publishing should finish.

Discussion

The publisher finishes when the closure returns false.