Instance Method

replaceEmpty(with:)

Replaces an empty stream with the provided element.

Declaration

func replaceEmpty(with output: Prefix.Output) -> Publishers.ReplaceEmpty<Publishers.Concatenate<Prefix, Suffix>>

Parameters

output

An element to emit when the upstream publisher finishes without emitting any elements.

Return Value

A publisher that replaces an empty stream with the provided output element.

Discussion

If the upstream publisher finishes without producing any elements, this publisher emits the provided element, then finishes normally.

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