Instance Method

prefix(_:)

Republishes elements up to the specified maximum count.

Declaration

func prefix(_ maxLength: Int) -> Publishers.Output<Publishers.MapKeyPath2<Upstream, Output0, Output1>>

Parameters

maxLength

The maximum number of elements to republish.

Return Value

A publisher that publishes up to the specified number of elements before completing.