Generic Structure


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


struct Just<Output>


You can use a Just publisher to start a chain of publishers. A Just publisher is also useful when replacing a value with Publishers.Catch.

In contrast with Result.Publisher, a Just publisher can’t fail with an error. And unlike Optional.Publisher, a Just publisher always produces a value.


Creating a Just Publisher


Initializes a publisher that emits the specified output just once.

Instance Properties

let output: Output

The one element that the publisher emits.

Instance Methods

func contains(Output) -> Just<Bool>
func contains(Output) -> Publishers.Contains<Just<Output>>
func max() -> Just<Output>
func max() -> Publishers.Comparison<Just<Output>>
func min() -> Just<Output>
func min() -> Publishers.Comparison<Just<Output>>
func removeDuplicates() -> Just<Output>
func switchToLatest() -> Publishers.SwitchToLatest<Output, Just<Output>>


Conforms To

See Also

Convenience Publishers

class Future

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

struct Deferred

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

struct Empty

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

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.


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