공통점
- 둘 다 동작하는 쓰레드를 지정하지 않음
- subscribe, bind 를 호출하는 쓰레드와 동일한 쓰레드에서 observing code 가 동작함
- subscribe(on:), observe(on:) 을 따로 chaining 하지 않았다는 가정하에
차이점
- bind 를 통해 binder 를 구독시킬수 있음
- binder 코드는 메인쓰레드에서 실행됨
bind better conveys intent, and enables writing more consistent binding code.
/**
Creates new subscription and sends elements to observer(s).
In this form, it's equivalent to the `subscribe` method, but it better conveys intent, and enables
writing more consistent binding code.
- parameter to: Observers to receives events.
- returns: Disposable object that can be used to unsubscribe the observers.
*/
public func bind<Observer: ObserverType>(to observers: Observer...) -> Disposable where Observer.Element == Element {
return self.bind(to: observers)
}