Skip to content

Commit

Permalink
Address PR feedback from @kzaher
Browse files Browse the repository at this point in the history
  • Loading branch information
freak4pc committed Apr 9, 2019
1 parent ba5cb7a commit 7a1abc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RxCocoa/Common/Observable+Bind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<E?>) -> Disposable {
public func bind(to relays: PublishRelay<E?>...) -> Disposable {
return self.map { $0 as E? }.bind(to: relays)
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/RxCocoaTests/Observable+BindTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int>).bind(to: relay1, relay2)

XCTAssertEqual(events1, [
.next(1)
Expand Down Expand Up @@ -282,7 +282,7 @@ extension ObservableBindTest {
let relay1 = BehaviorRelay<Int?>(value: 0)
let relay2 = BehaviorRelay<Int?>(value: 0)

_ = Observable.just(1).bind(to: relay1, relay2)
_ = (Observable.just(1) as Observable<Int>).bind(to: relay1, relay2)

XCTAssertEqual(relay1.value, 1)
XCTAssertEqual(relay2.value, 1)
Expand Down

0 comments on commit 7a1abc1

Please sign in to comment.