Disposable

  • A type-erased disposable that forwards operations to an underlying disposable.

    See more

    Declaration

    Swift

    public final class AnyDisposable: Disposable
  • A disposable that will run an action upon disposal.

    See more

    Declaration

    Swift

    public final class ActionDisposable: Disposable
  • Represents something that can be “disposed”, usually associated with freeing resources or canceling work.

    See more

    Declaration

    Swift

    public protocol Disposable: class
  • A disposable that will dispose of any number of other disposables.

    See more

    Declaration

    Swift

    public final class CompositeDisposable: Disposable
  • A disposable that, upon deinitialization, will automatically dispose of its inner disposable.

    See more

    Declaration

    Swift

    public final class ScopedDisposable<Inner: Disposable>: Disposable
  • A disposable that disposes of its wrapped disposable, and allows its wrapped disposable to be replaced.

    See more

    Declaration

    Swift

    public final class SerialDisposable: Disposable
  • A disposable that only flips isDisposed upon disposal, and performs no other work.

    See more

    Declaration

    Swift

    public final class SimpleDisposable: Disposable
  • Adds the right-hand-side disposable to the left-hand-side CompositeDisposable.

     disposable += producer
         .filter { ... }
         .map    { ... }
         .start(observer)
    

    Declaration

    Swift

    public func +=(lhs: CompositeDisposable, rhs: Disposable?) -> CompositeDisposable.DisposableHandle

    Parameters

    lhs

    Disposable to add to.

    rhs

    Disposable to add.

    Return Value

    An instance of DisposableHandle that can be used to opaquely remove the disposable later (if desired).

  • Adds the right-hand-side ActionDisposable to the left-hand-side CompositeDisposable.

    disposable += { ... }
    

    Declaration

    Swift

    public func +=(lhs: CompositeDisposable, rhs: @escaping () -> ()) -> CompositeDisposable.DisposableHandle

    Parameters

    lhs

    Disposable to add to.

    rhs

    Closure to add as a disposable.

    Return Value

    An instance of DisposableHandle that can be used to opaquely remove the disposable later (if desired).

  • Adds the right-hand-side disposable to the left-hand-side ScopedDisposable<CompositeDisposable>.

    disposable += { ... }
    

    Declaration

    Swift

    public func +=(lhs: ScopedDisposable<CompositeDisposable>, rhs: Disposable?) -> CompositeDisposable.DisposableHandle

    Parameters

    lhs

    Disposable to add to.

    rhs

    Disposable to add.

    Return Value

    An instance of DisposableHandle that can be used to opaquely remove the disposable later (if desired).

  • Adds the right-hand-side disposable to the left-hand-side ScopedDisposable<CompositeDisposable>.

    disposable += { ... }
    

    Declaration

    Swift

    public func +=(lhs: ScopedDisposable<CompositeDisposable>, rhs: @escaping () -> ()) -> CompositeDisposable.DisposableHandle

    Parameters

    lhs

    Disposable to add to.

    rhs

    Closure to add as a disposable.

    Return Value

    An instance of DisposableHandle that can be used to opaquely remove the disposable later (if desired).