CompositeDisposable
public final class CompositeDisposable: Disposable
A disposable that will dispose of any number of other disposables.
-
Represents a handle to a disposable previously added to a
See moreCompositeDisposable.Declaration
Swift
public final class DisposableHandle -
Remove the pointed-to disposable from its
CompositeDisposable.Note
This is useful to minimize memory growth, by removing disposables that are no longer needed.Declaration
Swift
public var isDisposed: Bool -
Initialize a
CompositeDisposablecontaining the given sequence of disposables.Declaration
Swift
public init<S: Sequence>(_ disposables: S) where S.Iterator.Element == DisposableParameters
disposablesA collection of objects conforming to the
Disposableprotocol -
Initialize a
CompositeDisposablecontaining the given sequence of disposables.Declaration
Swift
public convenience init<S: Sequence>(_ disposables: S) where S.Iterator.Element == Disposable?Parameters
disposablesA collection of objects conforming to the
Disposableprotocol -
Initializes an empty
CompositeDisposable.Declaration
Swift
public convenience init() -
Initializes an empty
CompositeDisposable.Declaration
Swift
public func dispose() -
Add the given disposable to the list, then return a handle which can be used to opaquely remove the disposable later (if desired).
Declaration
Swift
public func add(_ d: Disposable?) -> DisposableHandleParameters
dOptional disposable.
Return Value
An instance of
DisposableHandlethat can be used to opaquely remove the disposable later (if desired). -
Add an ActionDisposable to the list.
Declaration
Swift
public func add(_ action: @escaping () -> Void) -> DisposableHandleParameters
actionA closure that will be invoked when
dispose()is called.Return Value
An instance of
DisposableHandlethat can be used to opaquely remove the disposable later (if desired).
View on GitHub
Install in Dash
CompositeDisposable Class Reference