Skip to content

Commit 8af8d25

Browse files
committed
Add the rest of the test cases.
1 parent 6b2c476 commit 8af8d25

File tree

2 files changed

+431
-6
lines changed

2 files changed

+431
-6
lines changed

Sources/ParseSwift/LiveQuery/Subscription.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ private func == <T>(lhs: Event<T>, rhs: Event<T>) -> Bool {
6060
/**
6161
A default implementation of the `ParseSubscription` protocol. Suitable for `ObjectObserved`
6262
as the subscription can be used as a SwiftUI publisher. Meaning it can serve
63-
indepedently as a ViewModel in MVVM.
63+
indepedently as a ViewModel in MVVM. Also provides a publisher for pull responses of query such as:
64+
`find`, `first`, `count`, and `aggregate`.
6465
*/
6566
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
6667
open class Subscription<T: ParseObject>: ParseSubscription, ObservableObject {
@@ -206,7 +207,10 @@ open class Subscription<T: ParseObject>: ParseSubscription, ObservableObject {
206207
- parameter options: A set of header options sent to the server. Defaults to an empty set.
207208
- parameter callbackQueue: The queue to return to after completion. Default value of .main.
208209
*/
209-
open func find(explain: Bool, hint: String? = nil, options: API.Options = [], callbackQueue: DispatchQueue = .main) {
210+
open func find(explain: Bool,
211+
hint: String? = nil,
212+
options: API.Options = [],
213+
callbackQueue: DispatchQueue = .main) {
210214
query.find(explain: explain, hint: hint, options: options, callbackQueue: callbackQueue) { result in
211215
switch result {
212216

@@ -246,7 +250,10 @@ open class Subscription<T: ParseObject>: ParseSubscription, ObservableObject {
246250
- parameter options: A set of header options sent to the server. Defaults to an empty set.
247251
- parameter callbackQueue: The queue to return to after completion. Default value of `.main`.
248252
*/
249-
open func first(explain: Bool, hint: String? = nil, options: API.Options = [], callbackQueue: DispatchQueue = .main) {
253+
open func first(explain: Bool,
254+
hint: String? = nil,
255+
options: API.Options = [],
256+
callbackQueue: DispatchQueue = .main) {
250257
query.first(explain: explain, hint: hint, options: options, callbackQueue: callbackQueue) { result in
251258
switch result {
252259

@@ -283,7 +290,10 @@ open class Subscription<T: ParseObject>: ParseSubscription, ObservableObject {
283290
- parameter options: A set of header options sent to the server. Defaults to an empty set.
284291
- parameter callbackQueue: The queue to return to after completion. Default value of `.main`.
285292
*/
286-
open func count(explain: Bool, hint: String? = nil, options: API.Options = [], callbackQueue: DispatchQueue = .main) {
293+
open func count(explain: Bool,
294+
hint: String? = nil,
295+
options: API.Options = [],
296+
callbackQueue: DispatchQueue = .main) {
287297
query.count(explain: explain, hint: hint, options: options) { result in
288298
switch result {
289299

0 commit comments

Comments
 (0)