DataStoreSubscribeBehavior
public protocol DataStoreSubscribeBehavior
-
Returns a Publisher for model changes (create, updates, delete)
Declaration
Swift
@available(iOS 13.0, *) func publisher<M>(for modelType: M.Type) -> AnyPublisher<MutationEvent, DataStoreError> where M : Model
Parameters
modelType
The model type to observe
-
Returns a Publisher for query snapshots.
Declaration
Swift
@available(iOS 13.0, *) func observeQuery<M: Model>(for modelType: M.Type, where predicate: QueryPredicate?, sort sortInput: QuerySortInput?) -> AnyPublisher<DataStoreQuerySnapshot<M>, DataStoreError>
Parameters
modelType
The model type to observe
predicate
The predicate to match for filtered results
sortInput
The field and order of data to be returned