-
-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I'm using RxTest to test my network services which makes use of a virtual time TestScheduler. However, in Single+ModelMapper, you have fixed schedulers which are incompatible with RxTest as they would have to be replaced by the TestScheduler for unit tests. Similar discussion is here: ReactiveX/RxSwift#1100
Fix would be to do dependency injection of schedulers, perhaps with a default value.
Problematic code here:
public func map<T: Mappable>(to type: T.Type, keyPath: String? = nil) -> Single<T> {
return observeOn(ConcurrentDispatchQueueScheduler(qos: .background))
.flatMap { response -> Single<T> in
return Single.just(try response.map(to: type, keyPath: keyPath))
}
.observeOn(MainScheduler.instance)
}Metadata
Metadata
Assignees
Labels
No labels