@@ -16,14 +16,14 @@ extension ObservableType {
16
16
- parameter obj: The object that owns the function
17
17
- parameter method: The instance function represented as `InstanceType.instanceFunc`
18
18
*/
19
- fileprivate func weakify< A : AnyObject , B > ( _ obj: A , method: ( ( A ) -> ( B ) -> Void ) ? ) -> ( ( B ) -> Void ) {
19
+ fileprivate func weakify< Object : AnyObject , Input > ( _ obj: Object , method: ( ( Object ) -> ( Input ) -> Void ) ? ) -> ( ( Input ) -> Void ) {
20
20
return { [ weak obj] value in
21
21
guard let obj = obj else { return }
22
22
method ? ( obj) ( value)
23
23
}
24
24
}
25
25
26
- fileprivate func weakify< A : AnyObject > ( _ obj: A , method: ( ( A ) -> ( ) -> Void ) ? ) -> ( ( ) -> Void ) {
26
+ fileprivate func weakify< Object : AnyObject > ( _ obj: Object , method: ( ( Object ) -> ( ) -> Void ) ? ) -> ( ( ) -> Void ) {
27
27
return { [ weak obj] in
28
28
guard let obj = obj else { return }
29
29
method ? ( obj) ( )
@@ -37,7 +37,7 @@ extension ObservableType {
37
37
- parameter on: Function to invoke on `weak` for each event in the observable sequence.
38
38
- returns: Subscription object used to unsubscribe from the observable sequence.
39
39
*/
40
- public func subscribe< A : AnyObject > ( weak obj: A , _ on: @escaping ( A ) -> ( Event < Element > ) -> Void ) -> Disposable {
40
+ public func subscribe< Object : AnyObject > ( weak obj: Object , _ on: @escaping ( Object ) -> ( Event < Element > ) -> Void ) -> Disposable {
41
41
return self . subscribe ( weakify ( obj, method: on) )
42
42
}
43
43
@@ -52,13 +52,13 @@ extension ObservableType {
52
52
gracefully completed, errored, or if the generation is cancelled by disposing subscription)
53
53
- returns: Subscription object used to unsubscribe from the observable sequence.
54
54
*/
55
- public func subscribe< A : AnyObject > (
56
- weak obj: A ,
57
- onNext: ( ( A ) -> ( Element ) -> Void ) ? = nil ,
58
- onError: ( ( A ) -> ( Error ) -> Void ) ? = nil ,
59
- onCompleted: ( ( A ) -> ( ) -> Void ) ? = nil ,
60
- onDisposed: ( ( A ) -> ( ) -> Void ) ? = nil )
61
- -> Disposable {
55
+ public func subscribe< Object : AnyObject > (
56
+ weak obj: Object ,
57
+ onNext: ( ( Object ) -> ( Element ) -> Void ) ? = nil ,
58
+ onError: ( ( Object ) -> ( Error ) -> Void ) ? = nil ,
59
+ onCompleted: ( ( Object ) -> ( ) -> Void ) ? = nil ,
60
+ onDisposed: ( ( Object ) -> ( ) -> Void ) ? = nil
61
+ ) -> Disposable {
62
62
let disposable : Disposable
63
63
64
64
if let disposed = onDisposed {
@@ -91,7 +91,7 @@ extension ObservableType {
91
91
- parameter onNext: Function to invoke on `weak` for each element in the observable sequence.
92
92
- returns: Subscription object used to unsubscribe from the observable sequence.
93
93
*/
94
- public func subscribeNext< A : AnyObject > ( weak obj: A , _ onNext: @escaping ( A ) -> ( Element ) -> Void ) -> Disposable {
94
+ public func subscribeNext< Object : AnyObject > ( weak obj: Object , _ onNext: @escaping ( Object ) -> ( Element ) -> Void ) -> Disposable {
95
95
return self . subscribe ( onNext: weakify ( obj, method: onNext) )
96
96
}
97
97
@@ -102,7 +102,7 @@ extension ObservableType {
102
102
- parameter onError: Function to invoke on `weak` upon errored termination of the observable sequence.
103
103
- returns: Subscription object used to unsubscribe from the observable sequence.
104
104
*/
105
- public func subscribeError< A : AnyObject > ( weak obj: A , _ onError: @escaping ( A ) -> ( Error ) -> Void ) -> Disposable {
105
+ public func subscribeError< Object : AnyObject > ( weak obj: Object , _ onError: @escaping ( Object ) -> ( Error ) -> Void ) -> Disposable {
106
106
return self . subscribe ( onError: weakify ( obj, method: onError) )
107
107
}
108
108
@@ -113,7 +113,7 @@ extension ObservableType {
113
113
- parameter onCompleted: Function to invoke on `weak` graceful termination of the observable sequence.
114
114
- returns: Subscription object used to unsubscribe from the observable sequence.
115
115
*/
116
- public func subscribeCompleted< A : AnyObject > ( weak obj: A , _ onCompleted: @escaping ( A ) -> ( ) -> Void ) -> Disposable {
116
+ public func subscribeCompleted< Object : AnyObject > ( weak obj: Object , _ onCompleted: @escaping ( Object ) -> ( ) -> Void ) -> Disposable {
117
117
return self . subscribe ( onCompleted: weakify ( obj, method: onCompleted) )
118
118
}
119
119
}
0 commit comments