Skip to content

Commit

Permalink
Upgrade RxSwift to version 6.0 (#18)
Browse files Browse the repository at this point in the history
* Upgrade RxSwift to version 6.0, fixed compile errors

* Code review fixes

* Updated documentation
  • Loading branch information
modestman authored Mar 17, 2021
1 parent 3a27f76 commit 3eb6370
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Apexy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Pod::Spec.new do |s|
s.subspec 'RxSwift' do |sp|
sp.source_files = "Sources/ApexyRxSwift/*.swift"
sp.dependency "Apexy/Core"
sp.dependency "RxSwift"
sp.dependency "RxSwift", '~>6.0'
end

s.subspec 'Loader' do |sp|
Expand Down
2 changes: 1 addition & 1 deletion Documentation/reactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bookService.fetchBooks()
.subscribe(onSuccess: { [weak self] books in
self?.activityView.isHidden = true
self?.show(books: books)
}, onError: { [weak self] error in
}, onFailure: { [weak self] error in
self?.activityView.isHidden = true
self?.resultLabel.text = error.localizedDescription
}).disposed(by: bag)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/reactive.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bookService.fetchBooks()
.subscribe(onSuccess: { [weak self] books in
self?.activityView.isHidden = true
self?.show(books: books)
}, onError: { [weak self] error in
}, onFailure: { [weak self] error in
self?.activityView.isHidden = true
self?.resultLabel.text = error.localizedDescription
}).disposed(by: bag)
Expand Down
14 changes: 7 additions & 7 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- Alamofire (5.2.2)
- Apexy (1.2.1):
- Apexy/Alamofire (= 1.2.1)
- Apexy/Alamofire (1.2.1):
- Alamofire (5.4.1)
- Apexy (1.3.0):
- Apexy/Alamofire (= 1.3.0)
- Apexy/Alamofire (1.3.0):
- Alamofire (~> 5.0)
- Apexy/Core
- Apexy/Core (1.2.1)
- Apexy/Core (1.3.0)

DEPENDENCIES:
- Apexy (from `../`)
Expand All @@ -19,8 +19,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0
Apexy: 5ec1b45cefe40652354575bad31a73195af59d9f
Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c
Apexy: f6d81271bf1228dd10ddd86c24fb4f1a0fdc85fd

PODFILE CHECKSUM: f86a90e7590ccb3aa7caeceaf315abe256650c66

Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/ReactiveX/RxSwift.git",
"state": {
"branch": null,
"revision": "002d325b0bdee94e7882e1114af5ff4fe1e96afa",
"version": "5.1.1"
"revision": "7e01c05f25c025143073eaa3be3532f9375c614b",
"version": "6.1.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.2.0")),
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0")
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.0.0")
],
targets: [
.target(name: "ApexyLoader", dependencies: ["Apexy"]),
Expand Down
9 changes: 1 addition & 8 deletions Sources/ApexyRxSwift/Client+RxSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ public extension Client {

func request<T>(_ endpoint: T) -> Single<T.Content> where T: Endpoint {
Single.create { single in
let progress = self.request(endpoint) { (result: Result<T.Content, Error>) in
switch result {
case .success(let content):
single(.success(content))
case .failure(let error):
single(.error(error))
}
}
let progress = self.request(endpoint) { single($0) }
return Disposables.create(with: progress.cancel)
}
}
Expand Down

0 comments on commit 3eb6370

Please sign in to comment.