PubSub
-
A class that allows to subscribe for events until the returned subscription is disposed.
See moreDeclaration
Swift
public class Observable<Element> : Subscribable -
A protocol to provide all publisher-like classes access to a corresponding observable.
See moreDeclaration
Swift
public protocol ObservableConvertible<Element> -
An observable that holds the current value as the current state.
You can use
See moreupdatesto receive only future updates in a new observable.Declaration
Swift
public class ObservableState<Element> : Observable<Element> -
Contains factory methods for creating common
See moreObservableinstances for use with the Tealium SDK.Declaration
Swift
public enum Observables -
A protocol to provide all publisher-like classes some utilities like
See morepublish()forVoidevents.Declaration
Swift
public protocol Publisher : ObservableConvertible -
A
Subjectthat, in addition to normal publish and subscribe behavior, holds a cache of items and sends it, in order, to each new observer that is subscribed.You can use it as a property wrapper to make the publishing private in the class where it’s contained, but still expose an
See moreObservableto the other classes.Declaration
Swift
@propertyWrapper public class ReplaySubject<Element> : Subject<Element> -
A
Subjectthat must always have a value.You can use it as a property wrapper to make the publishing private in the class where it’s contained, but still expose an
See moreObservableStateto the other classes.Declaration
Swift
@propertyWrapper public class StateSubject<Element> : Subject<Element> -
A
Publisherthat can be also subscribed to.You can use it as a property wrapper to make the publishing private in the class where it’s contained, but still expose an
See moreObservableto the other classes.Declaration
Swift
@propertyWrapper public class Subject<Element> : BasePublisher<Element>, Subscribable -
A
See moreSubscribableimplementation whereby only a single result is expected to be emitted to the subscriber.Declaration
Swift
public protocol Single<Element> : Subscribable -
SingleResultFrom TealiumPrismCoreA
Singlethat completes with aResult<T, Error>.With a
SingleResultyou cansubscribeas any other type ofSingle, but you can also subscribe only foronSuccessoronFailureto receive the event only in case the event is respectively either a success or a failure.So in case you want to handle both success and failure:
single.subscribe { result in switch result { case let .success(output): // Handle success break case let .failure(error): // Handle failure break }In case you want to handle only successes:
single.onSuccess { output in // Handle success }In case you want to handle only failures:
single.onFailure { error in // Handle failure }Declaration
Swift
public typealias SingleResult<T, E> = any Single<Result<T, E>> where E : Error -
A group that contains many disposable objects and disposes them simultaneously.
See moreDeclaration
Swift
public protocol CompositeDisposable : Disposable -
An protocol representing some long-lived operation that can be disposed.
See moreDeclaration
Swift
public protocol Disposable -
Contains factory methods for creating common
See moreDisposableinstances for use with the Tealium SDK.Declaration
Swift
public enum Disposables -
A protocol to provide all observable-like classes some utilities like subscribeOnce or the operators.
See moreDeclaration
Swift
public protocol Subscribable<Element> : ObservableConvertible -
An object from which you can extract an optional value.
See moreDeclaration
Swift
public protocol ValueExtractor<ValueType>
View on GitHub
PubSub Reference