BoxPublisher

@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public class BoxPublisher<E>: Publisher
where E: EntityInspectable & __EntityRelatable, E.EntityBindingType.EntityType == E

Combine publisher for an ObjectBox box. You obtain an instance of this type via the publisher property on Box.

  • The result type of this publisher.

    Declaration

    Swift

    public typealias Output = [E]
  • The error type of this publisher.

    Declaration

    Swift

    public typealias Failure = ObjectBoxError
  • Register a combine subscriber to be notified whenever entities are added/modified/removed. Notifications are dispatched on the main queue.

    Declaration

    Swift

    public func receive<S>(subscriber: S)
        where S: Subscriber, BoxPublisher.Failure == S.Failure, BoxPublisher.Output == S.Input

    Parameters

    subscriber

    The subscriber you want to receive the subscription.

  • Register a combine subscriber to be notified whenever entities are added/modified/removed.

    Declaration

    Swift

    public func receive<S>(subscriber: S, dispatchQueue: DispatchQueue)
        where S: Subscriber, BoxPublisher.Failure == S.Failure, BoxPublisher.Output == S.Input

    Parameters

    subscriber

    The subscriber you want to receive the subscription.

    dispatchQueue

    The queue on which new data and completion are to be delivered.