DittoStoreObserver

public class DittoStoreObserver
extension DittoStoreObserver: Hashable
extension DittoStoreObserver: Equatable

A store observer invokes an observation handler whenever results for its query change.

Create a store observer by calling DittoStore.registerObserver(). The store observer will remain active until the owning Ditto object goes out of scope or DittoStoreObserver.cancel() is called.

  • The Ditto object this store observer is registered with.

    Declaration

    Swift

    public private(set) weak var ditto: Ditto? { get }
  • The query string of the store observer (as passed when registering it).

    Declaration

    Swift

    public let queryString: String
  • The query arguments of the store observer (as passed when registering it).

    Declaration

    Swift

    public let queryArguments: Dictionary<String, Any?>?
  • Convenience property, returns true if the store obsever has been cancelled, otherwise returns false. Also, a store observer is considered cancelled if the owning Ditto object goes out of scope.

    Declaration

    Swift

    public var isCancelled: Bool { get }
  • Cancels the observation. The handler that was passed in when registering this store observer will no longer be called. No-op if this store observer is already cancelled or the owning Ditto object goes out of scope.

    Declaration

    Swift

    public func cancel()

Hashable

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

Equatable

  • Declaration

    Swift

    public static func == (left: DittoStoreObserver, right: DittoStoreObserver) -> Bool