Disposables
public enum Disposables
Contains factory methods for creating common Disposable instances for use with the Tealium SDK.
-
Creates a
Disposablewhich calls the givenunsubscribeblock when the subscription is disposed.The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.
Declaration
Swift
static func subscription(unsubscribe: @escaping () -> Void = { }) -> DisposableParameters
unsubscribeOptional callback to execute when this
Disposableis disposed.Return Value
A
Disposableto dispose of the subscription. -
Creates a
CompositeDisposablewhich can be used to store multipleDisposableinstances for bulk disposal.Additional
Disposableinstances can be added viaCompositeDisposable.add.The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.
Declaration
Swift
static func composite() -> CompositeDisposableReturn Value
A
CompositeDisposableto dispose of multipleDisposableat once. -
Creates a
CompositeDisposablewhich can be used to store multipleDisposableinstances for bulk disposal. All methods are executed using the givenqueueto ensure operation is thread-safe.Additional
Disposableinstances can be added viaCompositeDisposable.add.Declaration
Swift
static func composite(queue: TealiumQueue) -> CompositeDisposableParameters
queueThe
TealiumQueueimplementation to use for all operations of thisDisposable.Return Value
A
CompositeDisposableto dispose of multipleDisposableat once, whilst ensuring that all operations happen on the givenqueue. -
Creates a
CompositeDisposablewhich can be used to store multipleDisposableinstances for bulk disposal. ThisDisposablewill automatically dispose upon deinitialization.Additional
Disposableinstances can be added viaCompositeDisposable.add.The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.
Declaration
Swift
static func automaticComposite() -> CompositeDisposableReturn Value
A
CompositeDisposableto dispose of multipleDisposableat once. -
Returns a
Disposableimplementation that:- always returns
trueforDisposable.isDisposed does nothing for
Disposable.dispose
Declaration
Swift
static func disposed() -> Disposable - always returns
View on GitHub