Generic Structure


A publisher that never publishes any values, and optionally finishes immediately.


struct Empty<Output, Failure> where Failure : Error


You can create a ”Never” publisher — one which never sends values and never finishes or fails — with the initializer Empty(completeImmediately: false).



init(completeImmediately: Bool)

Creates an empty publisher.

init(completeImmediately: Bool, outputType: Output.Type, failureType: Failure.Type)

Creates an empty publisher with the given completion behavior and output and failure types.

Instance Properties

let completeImmediately: Bool

A Boolean value that indicates whether the publisher immediately sends a completion.

Instance Methods

func max() -> Publishers.Comparison<Empty<Output, Failure>>
func min() -> Publishers.Comparison<Empty<Output, Failure>>
func switchToLatest() -> Publishers.SwitchToLatest<Output, Empty<Output, Failure>>


Conforms To

See Also

Convenience Publishers

class Future

A publisher that eventually produces a single value and then finishes or fails.

struct Just

A publisher that emits an output to each subscriber just once, and then finishes.

struct Deferred

A publisher that awaits subscription before running the supplied closure to create a publisher for the new subscriber.

struct Fail

A publisher that immediately terminates with the specified error.

struct Record

A publisher that allows for recording a series of inputs and a completion, for later playback to each subscriber.