ScopedDisposable

final class ScopedDisposable<Inner> : Disposable where Inner : Disposable
  • Adds the right-hand-side disposable to the left-hand-side CompositeDisposable.

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

    Declaration

    Swift

    @discardableResult
    public static func += (lhs: ScopedDisposable<TypedSerialDisposable<CompositeDisposable>>, rhs: Disposable?) -> Disposable?

    Parameters

    lhs

    Disposable to add to.

    rhs

    Disposable to add.

    Return Value

    A Disposable that can be used to opaquely remove the disposable later (if desired).

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

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

    Declaration

    Swift

    @discardableResult
    public static func += (lhs: ScopedDisposable<TypedSerialDisposable<CompositeDisposable>>, rhs: @escaping () -> Void) -> Disposable?

    Parameters

    lhs

    Disposable to add to.

    rhs

    Disposable to add.

    Return Value

    A Disposable that can be used to opaquely remove the disposable later (if desired).