Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/ParseLiveQuery/Subscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ open class Subscription<T>: SubscriptionHandling where T: PFObject {

- returns: The same subscription, for easy chaining
*/
open func handleError(_ handler: @escaping (PFQuery<T>, Error) -> Void) -> Subscription {
@discardableResult open func handleError(_ handler: @escaping (PFQuery<T>, Error) -> Void) -> Subscription {
errorHandlers.append(handler)
return self
}
Expand All @@ -141,7 +141,7 @@ open class Subscription<T>: SubscriptionHandling where T: PFObject {

- returns: The same subscription, for easy chaining.
*/
open func handleEvent(_ handler: @escaping (PFQuery<T>, Event<T>) -> Void) -> Subscription {
@discardableResult open func handleEvent(_ handler: @escaping (PFQuery<T>, Event<T>) -> Void) -> Subscription {
eventHandlers.append(handler)
return self
}
Expand All @@ -153,7 +153,7 @@ open class Subscription<T>: SubscriptionHandling where T: PFObject {

- returns: The same subscription, for easy chaining.
*/
open func handleSubscribe(_ handler: @escaping (PFQuery<T>) -> Void) -> Subscription {
@discardableResult open func handleSubscribe(_ handler: @escaping (PFQuery<T>) -> Void) -> Subscription {
subscribeHandlers.append(handler)
return self
}
Expand All @@ -165,7 +165,7 @@ open class Subscription<T>: SubscriptionHandling where T: PFObject {

- returns: The same subscription, for easy chaining.
*/
open func handleUnsubscribe(_ handler: @escaping (PFQuery<T>) -> Void) -> Subscription {
@discardableResult open func handleUnsubscribe(_ handler: @escaping (PFQuery<T>) -> Void) -> Subscription {
unsubscribeHandlers.append(handler)
return self
}
Expand Down Expand Up @@ -208,7 +208,7 @@ extension Subscription {

- returns: The same subscription, for easy chaining
*/
public func handle<E: Error>(
@discardableResult public func handle<E: Error>(
_ errorType: E.Type = E.self,
_ handler: @escaping (PFQuery<T>, E) -> Void
) -> Subscription {
Expand All @@ -235,7 +235,7 @@ extension Subscription {
- returns: The same subscription, for easy chaining

*/
public func handle(_ eventType: @escaping (T) -> Event<T>, _ handler: @escaping (PFQuery<T>, T) -> Void) -> Subscription {
@discardableResult public func handle(_ eventType: @escaping (T) -> Event<T>, _ handler: @escaping (PFQuery<T>, T) -> Void) -> Subscription {
return handleEvent { query, event in
switch event {
case .entered(let obj) where eventType(obj) == event: handler(query, obj)
Expand Down