DataStoreSubscribeBehavior
public protocol DataStoreSubscribeBehavior
-
Returns an AmplifyAsyncThrowingSequence for model changes (create, updates, delete)
Declaration
Swift
func observe<M>(_ modelType: M.Type) -> AmplifyAsyncThrowingSequence<MutationEvent> where M : Model
Parameters
modelType
The model type to observe
-
Returns a Publisher for query snapshots.
Declaration
Swift
func observeQuery<M: Model>(for modelType: M.Type, where predicate: QueryPredicate?, sort sortInput: QuerySortInput?) -> AmplifyAsyncThrowingSequence<DataStoreQuerySnapshot<M>>
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