From 7a1abc1c5db27ae0bb46c779e07a5575244e0766 Mon Sep 17 00:00:00 2001 From: freak4pc Date: Tue, 9 Apr 2019 22:29:39 +0300 Subject: [PATCH] Address PR feedback from @kzaher --- RxCocoa/Common/Observable+Bind.swift | 2 +- Tests/RxCocoaTests/Observable+BindTests.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RxCocoa/Common/Observable+Bind.swift b/RxCocoa/Common/Observable+Bind.swift index 127bd22dd..935bcb709 100644 --- a/RxCocoa/Common/Observable+Bind.swift +++ b/RxCocoa/Common/Observable+Bind.swift @@ -74,7 +74,7 @@ extension ObservableType { - parameter to: Target publish relays for sequence elements. - returns: Disposable object that can be used to unsubscribe the observer. */ - public func bind(to relays: PublishRelay) -> Disposable { + public func bind(to relays: PublishRelay...) -> Disposable { return self.map { $0 as E? }.bind(to: relays) } diff --git a/Tests/RxCocoaTests/Observable+BindTests.swift b/Tests/RxCocoaTests/Observable+BindTests.swift index 581bd74ff..e2643dad6 100644 --- a/Tests/RxCocoaTests/Observable+BindTests.swift +++ b/Tests/RxCocoaTests/Observable+BindTests.swift @@ -220,7 +220,7 @@ extension ObservableBindTest { events2.append(Recorded(time: 0, value: event)) } - _ = Observable.just(1).bind(to: relay1, relay2) + _ = (Observable.just(1) as Observable).bind(to: relay1, relay2) XCTAssertEqual(events1, [ .next(1) @@ -282,7 +282,7 @@ extension ObservableBindTest { let relay1 = BehaviorRelay(value: 0) let relay2 = BehaviorRelay(value: 0) - _ = Observable.just(1).bind(to: relay1, relay2) + _ = (Observable.just(1) as Observable).bind(to: relay1, relay2) XCTAssertEqual(relay1.value, 1) XCTAssertEqual(relay2.value, 1)