ObservableConvertibleType

public extension ObservableConvertibleType
  • Creates new subscription and sends elements to a Combine Subject.

    Seealso

    AnyOserverConvertible

    Declaration

    Swift

    func bind<S>(to subject: S) -> Disposable where S : AnyObserverConvertible, Self.Element == S.Output

    Parameters

    to

    Combine subject to receives events.

    Return Value

    Disposable object that can be used to unsubscribe the observers.

  • An AnyPublisher of the underlying Observable’s Element type so the Observable pushes events to the Publisher.

    Declaration

    Swift

    var publisher: AnyPublisher<Element, Swift.Error> { get }
  • Returns a AnyPublisher of the underlying Observable’s Element type so the Observable pushes events to the Publisher.

    Note

    This is an alias for the publisher property.

    Declaration

    Swift

    func asPublisher() -> AnyPublisher<Element, Swift.Error>

    Return Value

    AnyPublisher of the underlying Observable’s Element type.