Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
[General] Update for RxSwift & ReactiveSwift
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinejr committed Nov 10, 2016
1 parent 4eed7c9 commit 6c46fe3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SPEC CHECKSUMS:
Alamofire: 7682d43245de14874acd142ec137b144aa1dd335
JASON: cf4d762e61428a20db8eaef2acb6a569a10c1801
Moya: bad6f72ec40661f09a8cd85ab470226d2795a485
Moya-JASON: 70e10d4d45367a715a1629105bb8048a7e3b02c2
Moya-JASON: 5900f09bcf1114f07bca5d45f2f7d9e29009219b
Result: 1b3e431f37cbcd3ad89c6aa9ab0ae55515fae3b6

PODFILE CHECKSUM: 9e73af95c0fc56a4a5804903becc9ff90d190bb6
Expand Down
2 changes: 1 addition & 1 deletion Example/Pods/Local Podspecs/Moya-JASON.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Moya-JASON.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Pod::Spec.new do |s|

s.subspec "ReactiveCocoa" do |ss|
ss.source_files = "Source/ReactiveCocoa/*.swift"
ss.dependency "Moya/ReactiveCocoa", "8.0.0-alpha.4"
ss.dependency "Moya/ReactiveCocoa", "8.0.0-beta.4"
ss.dependency "Moya-JASON/Core"
ss.dependency "ReactiveSwift", "1.0.0-alpha.3"
end
Expand Down
8 changes: 4 additions & 4 deletions Source/ReactiveCocoa/SignalProducer+ModelMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
// Copyright (c) 2016 Droids On Roids. All rights reserved.
//

import ReactiveCocoa
import ReactiveSwift
import Moya
import JASON

/// Extension for processing Responses into Mappable objects through ObjectMapper
extension SignalProducerType where Value == Moya.Response, Error == Moya.Error {
extension SignalProducerProtocol where Value == Moya.Response, Error == Moya.Error {

/// Maps data received from the signal into an object which implements the Mappable protocol.
/// If the conversion fails, the signal errors.
public func mapObject<T: Mappable>(type: T.Type, keyPath: [Any] = []) -> SignalProducer<T, Error> {
return producer.flatMap(.Latest) { response -> SignalProducer<T, Error> in
return producer.flatMap(.latest) { response -> SignalProducer<T, Error> in
return unwrapThrowable { try response.mapObject(withKeyPath: keyPath) }
}
}
Expand All @@ -25,7 +25,7 @@ extension SignalProducerType where Value == Moya.Response, Error == Moya.Error {
/// protocol.
/// If the conversion fails, the signal errors.
public func mapArray<T: Mappable>(type: T.Type, keyPath: [Any] = []) -> SignalProducer<[T], Error> {
return producer.flatMap(.Latest) { response -> SignalProducer<[T], Error> in
return producer.flatMap(.latest) { response -> SignalProducer<[T], Error> in
return unwrapThrowable { try response.mapArray(withKeyPath: keyPath) }
}
}
Expand Down
4 changes: 2 additions & 2 deletions Source/RxSwift/Observable+ModelMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension ObservableType where E == Response {
/// implements the Mappable protocol and returns the result back on the MainScheduler.
/// If the conversion fails, the signal errors.
public func mapObject<T: Mappable>(type: T.Type, keyPath: [Any] = []) -> Observable<T> {
return observeOn(SerialDispatchQueueScheduler(globalConcurrentQueueQOS: .Background))
return observeOn(SerialDispatchQueueScheduler(qos: .background))
.flatMap { response -> Observable<T> in
return Observable.just(try response.mapObject(withKeyPath: keyPath))
}
Expand All @@ -29,7 +29,7 @@ public extension ObservableType where E == Response {
/// which implement the Mappable protocol and returns the result back on the MainScheduler
/// If the conversion fails, the signal errors.
public func mapArray<T: Mappable>(type: T.Type, keyPath: [Any] = []) -> Observable<[T]> {
return observeOn(SerialDispatchQueueScheduler(globalConcurrentQueueQOS: .Background))
return observeOn(SerialDispatchQueueScheduler(qos: .background))
.flatMap { response -> Observable<[T]> in
return Observable.just(try response.mapArray(withKeyPath: keyPath))
}
Expand Down

0 comments on commit 6c46fe3

Please sign in to comment.