Replaces all calls to `StableCompositeDisposable.create()` with `Disposables.create()`.

This commit is contained in:
Mo Ramezanpoor 2016-08-10 14:49:21 +01:00
parent 1fe15bb9da
commit 64526c8dcd
13 changed files with 15 additions and 15 deletions

View File

@ -69,7 +69,7 @@ func <-> (textInput: RxTextInput, variable: Variable<String>) -> Disposable {
bindToUIDisposable.dispose()
})
return StableCompositeDisposable.create(bindToUIDisposable, bindToVariable)
return Disposables.create(bindToUIDisposable, bindToVariable)
}
func <-> <T>(property: ControlProperty<T>, variable: Variable<T>) -> Disposable {
@ -92,7 +92,7 @@ func <-> <T>(property: ControlProperty<T>, variable: Variable<T>) -> Disposable
bindToUIDisposable.dispose()
})
return StableCompositeDisposable.create(bindToUIDisposable, bindToVariable)
return Disposables.create(bindToUIDisposable, bindToVariable)
}
// }

View File

@ -40,7 +40,7 @@ class AddRef<Element> : Producer<Element> {
override func run<O: ObserverType where O.E == Element>(_ observer: O) -> Disposable {
let releaseDisposable = _refCount.retain()
let sink = AddRefSink(observer: observer)
sink.disposable = StableCompositeDisposable.create(releaseDisposable, _source.subscribeSafe(sink))
sink.disposable = Disposables.create(releaseDisposable, _source.subscribeSafe(sink))
return sink
}

View File

@ -66,7 +66,7 @@ class AmbSink<ElementType, O: ObserverType where O.E == ElementType> : Sink<O> {
func run() -> Disposable {
let subscription1 = SingleAssignmentDisposable()
let subscription2 = SingleAssignmentDisposable()
let disposeAll = StableCompositeDisposable.create(subscription1, subscription2)
let disposeAll = Disposables.create(subscription1, subscription2)
let forwardEvent = { (o: AmbObserverType, event: Event<ElementType>) -> Void in
self.forwardOn(event)

View File

@ -53,7 +53,7 @@ class BufferTimeCountSink<Element, O: ObserverType where O.E == [Element]>
func run() -> Disposable {
createTimer(_windowID)
return StableCompositeDisposable.create(_timerD, _parent._source.subscribe(self))
return Disposables.create(_timerD, _parent._source.subscribe(self))
}
func startNewWindowAndSendCurrentOne() {

View File

@ -127,7 +127,7 @@ class RetryWhenSequenceSink<S: Sequence, O: ObserverType, TriggerObservable: Obs
override func run(_ sources: SequenceGenerator) -> Disposable {
let triggerSubscription = _handler.subscribe(_notifier.asObserver())
let superSubscription = super.run(sources)
return StableCompositeDisposable.create(superSubscription, triggerSubscription)
return Disposables.create(superSubscription, triggerSubscription)
}
}

View File

@ -88,7 +88,7 @@ class SampleSequenceSink<O: ObserverType, SampleType>
_sourceSubscription.disposable = _parent._source.subscribe(self)
let samplerSubscription = _parent._sampler.subscribe(SamplerSink(parent: self))
return StableCompositeDisposable.create(_sourceSubscription, samplerSubscription)
return Disposables.create(_sourceSubscription, samplerSubscription)
}
func on(_ event: Event<Element>) {

View File

@ -103,7 +103,7 @@ class SkipUntilSink<ElementType, Other, O: ObserverType where O.E == ElementType
_sourceSubscription.disposable = sourceSubscription
otherObserver._subscription.disposable = otherSubscription
return StableCompositeDisposable.create(_sourceSubscription, otherObserver._subscription)
return Disposables.create(_sourceSubscription, otherObserver._subscription)
}
}

View File

@ -32,7 +32,7 @@ class SwitchSink<SourceType, S: ObservableConvertibleType, O: ObserverType where
func run(_ source: Observable<SourceType>) -> Disposable {
let subscription = source.subscribe(self)
_subscriptions.disposable = subscription
return StableCompositeDisposable.create(_subscriptions, _innerSubscription)
return Disposables.create(_subscriptions, _innerSubscription)
}
func on(_ event: Event<E>) {

View File

@ -98,7 +98,7 @@ class TakeUntilSink<ElementType, Other, O: ObserverType where O.E == ElementType
otherObserver._subscription.disposable = otherSubscription
let sourceSubscription = _parent._source.subscribe(self)
return StableCompositeDisposable.create(sourceSubscription, otherObserver._subscription)
return Disposables.create(sourceSubscription, otherObserver._subscription)
}
}

View File

@ -35,7 +35,7 @@ class ThrottleSink<O: ObserverType>
func run() -> Disposable {
let subscription = _parent._source.subscribe(self)
return StableCompositeDisposable.create(subscription, cancellable)
return Disposables.create(subscription, cancellable)
}
func on(_ event: Event<Element>) {

View File

@ -35,7 +35,7 @@ class TimeoutSink<ElementType, O: ObserverType where O.E == ElementType>: Sink<O
original.disposable = _parent._source.subscribeSafe(self)
return StableCompositeDisposable.create(_subscription, _timerD)
return Disposables.create(_subscription, _timerD)
}
func on(_ event: Event<E>) {

View File

@ -28,12 +28,12 @@ class UsingSink<SourceType, ResourceType: Disposable, O: ObserverType where O.E
disposable = resource
let source = try _parent._observableFactory(resource)
return StableCompositeDisposable.create(
return Disposables.create(
source.subscribe(self),
disposable
)
} catch let error {
return StableCompositeDisposable.create(
return Disposables.create(
Observable.error(error).subscribe(self),
disposable
)

View File

@ -35,7 +35,7 @@ class WithLatestFromSink<FirstType, SecondType, ResultType, O: ObserverType wher
sndSubscription.disposable = _parent._second.subscribe(sndO)
let fstSubscription = _parent._first.subscribe(self)
return StableCompositeDisposable.create(fstSubscription, sndSubscription)
return Disposables.create(fstSubscription, sndSubscription)
}
func on(_ event: Event<E>) {