CombineErgonomics Documentation

Extensions on Publisher

Methods

run(on:​)

func run<S: Scheduler>(on scheduler: S) -> PromiseFinalizer<Self, S>  

Starts the given Future without attaching a completion handler.

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

Returns

PromiseFinalizer that can be used to handle any errors

run()

func run() -> PromiseFinalizer<Self, DispatchQueue>  

Starts the given Future without attaching a completion handler.

Returns

PromiseFinalizer that can be used to handle any errors

run(on:​)

func run<S: Scheduler>(on scheduler: S)
    where Failure == Never  

Starts the given Future without attaching a completion handler. This is a convenience method when Failure == Never

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

run()

func run()
    where Failure == Never  

Starts the given Future without attaching a completion handler. This is a convenience method when Failure == Never

done(on:​handler:​)

func done<S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> Void) -> PromiseFinalizer<Self, S>  

Add a closure to be executed after the publisher runs on a Scheduler and emits one single value

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping (Output) -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

Returns

PromiseFinalizer that can be used to handle any errors

done(_:​)

func done(_ handler: @escaping (Output) -> Void) -> PromiseFinalizer<Self, DispatchQueue>  

Add a closure to be executed after the publisher runs on DispatchQueue.global() and emits one single value

Parameters

handler @escaping (Output) -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

Returns

PromiseFinalizer that can be used to handle any errors.

done(on:​handler:​)

func done<S: Scheduler>(on scheduler: S, handler: @escaping () -> Void) -> PromiseFinalizer<Self, S>
    where Output == Void  

Add a closure to be executed after the publisher runs on a Scheduler and emits one single value This is a convenience method to simplify the use site when Output == Void

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping () -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

Returns

PromiseFinalizer that can be used to handle any errors

done(_:​)

func done(_ handler: @escaping () -> Void) -> PromiseFinalizer<Self, DispatchQueue>
    where Output == Void  

Add a closure to be executed after the publisher runs on DispatchQueue.global() and emits one single value This is a convenience method to simplify the use site when Output == Void

Parameters

handler @escaping () -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

Returns

PromiseFinalizer that can be used to handle any errors.

done(on:​handler:​)

func done<S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> Void)
    where Failure == Never  

Add a closure to be executed after the publisher runs on a Scheduler and emits one single value This is a convenience method when Failure == Never

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping (Output) -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

done(_:​)

func done(_ handler: @escaping (Output) -> Void)
    where Failure == Never  

Add a closure to be executed after the publisher runs on DispatchQueue.global() and emits one single value This is a convenience method when Failure == Never

Parameters

handler @escaping (Output) -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

done(on:​handler:​)

func done<S: Scheduler>(on scheduler: S, handler: @escaping () -> Void)
    where Output == Void, Failure == Never  

Add a closure to be executed after the publisher runs on a Scheduler and emits one single value This is a convenience method when Output == Void and Failure == Never

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping () -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

done(_:​)

func done(_ handler: @escaping () -> Void)
    where Output == Void, Failure == Never  

Add a closure to be executed after the publisher runs on DispatchQueue.global() and emits one single value This is a convenience method when Output == Void and Failure == Never

Parameters

handler @escaping () -> Void

The closure to run once the publisher has executed. This runs on DispatchQueue.main

then(on:​handler:​)

func then<P: Publisher, S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> P) -> Publishers.SubscribeOn<Publishers.FlatMap<P, Self>, S>  

Add a closure to be executed after the publisher runs on a Scheduler, and then return another publisher to run afterwards.

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping (Output) -> P

The closure to run once the publisher has executed. Returns a new Publisher.

Returns

Publisher that can be subscribed to

then(_:​)

func then<P: Publisher>(_ handler: @escaping (Output) -> P) -> Publishers.FlatMap<P, Self>  

Add a closure to be executed after the publisher runs on a Scheduler, and then return another publisher to run afterwards.

Parameters

handler @escaping (Output) -> P

The closure to run once the publisher has executed. Returns a new Publisher.

Returns

Publisher that can be subscribed to

then(on:​handler:​)

func then<P: Publisher, S: Scheduler>(on scheduler: S, handler: @escaping () -> P) -> Publishers.SubscribeOn<Publishers.FlatMap<P, Self>, S>
    where Output == Void  

Add a closure to be executed after the publisher runs on a Scheduler, and then return another publisher to run afterwards. This is a convenience method to simplify the use site when Output == Void

Parameters

scheduler S

DispatchQueue or other Scheduler on which the publisher executes

handler @escaping () -> P

The closure to run once the publisher has executed. Returns a new Publisher.

Returns

Publisher that can be subscribed to

then(_:​)

func then<P: Publisher>(_ handler: @escaping () -> P) -> Publishers.FlatMap<P, Self>
    where Output == Void  

Add a closure to be executed after the publisher runs on a Scheduler, and then return another publisher to run afterwards. This is a convenience method to simplify the use site when Output == Void

Parameters

handler @escaping () -> P

The closure to run once the publisher has executed. Returns a new Publisher.

Returns

Publisher that can be subscribed to