Skip to content

Commit 89ebf7d

Browse files
committed
RxSwiftExt 6
1 parent 7630239 commit 89ebf7d

14 files changed

+18
-244
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
XCODE_TEST_REPORTS: /tmp/xcode-test-results
99
LANG: en_US.UTF-8
1010
macos:
11-
xcode: '10.2.0'
11+
xcode: '12.3.0'
1212
steps:
1313
- checkout
1414
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS $XCODE_TEST_REPORTS
@@ -45,7 +45,7 @@ jobs:
4545
environment:
4646
LANG: en_US.UTF-8
4747
macos:
48-
xcode: '10.2.0'
48+
xcode: '12.3.0'
4949
steps:
5050
- checkout
5151
- run:

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "ReactiveX/RxSwift" ~> 5.0
1+
github "ReactiveX/RxSwift" "6.0.0"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "ReactiveX/RxSwift" "5.0.1"
1+
github "ReactiveX/RxSwift" "6.0.0"

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import PackageDescription
55
let package = Package(
66
name: "RxSwiftExt",
77
platforms: [
8-
.iOS(.v8), .tvOS(.v9), .macOS(.v10_11), .watchOS(.v3)
8+
.iOS(.v9), .tvOS(.v9), .macOS(.v10_11), .watchOS(.v3)
99
],
1010
products: [
1111
.library(name: "RxSwiftExt", targets: ["RxSwiftExt"]),
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.0.0")),
14+
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.0.0")),
1515
],
1616
targets: [
1717
.target(name: "RxSwiftExt", dependencies: ["RxSwift", "RxCocoa"], path: "Source"),
1818
.testTarget(name: "RxSwiftExtTests", dependencies: ["RxSwiftExt", "RxTest"], path: "Tests"),
1919
],
20-
swiftLanguageVersions: [.v4_2, .v5]
20+
swiftLanguageVersions: [.v5]
2121
)

Readme.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ These operators are much like the RxSwift & RxCocoa core operators, but provide
7373
* [Observable.fromAsync](#fromasync)
7474
* [Observable.zip(with:)](#zipwith)
7575
* [Observable.merge(with:)](#mergewith)
76-
* [withUnretained](#withunretained)
7776
* [count](#count)
7877
* [partition](#partition)
7978
* [bufferWithTrigger](#bufferWithTrigger)
@@ -565,40 +564,6 @@ completed
565564
```
566565
This example emits 2, 5 (`NSDecimalNumber` Type).
567566

568-
#### withUnretained
569-
570-
The `withUnretained(_:resultSelector:)` operator provides an unretained, safe to use (i.e. not implicitly unwrapped), reference to an object along with the events emitted by the sequence.
571-
In the case the provided object cannot be retained successfully, the seqeunce will complete.
572-
573-
```swift
574-
class TestClass: CustomStringConvertible {
575-
var description: String { return "Test Class" }
576-
}
577-
578-
Observable
579-
.of(1, 2, 3, 5, 8, 13, 18, 21, 23)
580-
.withUnretained(testClass)
581-
.do(onNext: { _, value in
582-
if value == 13 {
583-
// When testClass becomes nil, the next emission of the original
584-
// sequence will try to retain it and fail. As soon as it fails,
585-
// the sequence will complete.
586-
testClass = nil
587-
}
588-
})
589-
.subscribe()
590-
```
591-
592-
```
593-
next((Test Class, 1))
594-
next((Test Class, 2))
595-
next((Test Class, 3))
596-
next((Test Class, 5))
597-
next((Test Class, 8))
598-
next((Test Class, 13))
599-
completed
600-
```
601-
602567
#### [count](http://reactivex.io/documentation/operators/count.html)
603568

604569
Emits the number of items emitted by an Observable once it terminates with no errors. If a predicate is given, only elements matching the predicate will be counted.

RxSwiftExt.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxSwiftExt"
3-
s.version = "5.2.0"
3+
s.version = "6.0.0"
44
s.summary = "RxSwift operators not found in the core distribtion"
55
s.description = <<-DESC
66
A collection of operators for RxSwift adding commonly requested operations not found in the core distribution
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010
s.license = { :type => "MIT", :file => "LICENSE" }
1111
s.authors = { "RxSwiftCommunity" => "https://github.com/RxSwiftCommunity" }
1212

13-
s.ios.deployment_target = '8.0'
13+
s.ios.deployment_target = '9.0'
1414
s.osx.deployment_target = '10.10'
1515
s.watchos.deployment_target = '3.0'
1616
s.tvos.deployment_target = '9.0'
@@ -20,13 +20,13 @@ Pod::Spec.new do |s|
2020
s.subspec "Core" do |cs|
2121
cs.source_files = "Source/RxSwift", "Source/Tools"
2222
cs.frameworks = "Foundation"
23-
cs.dependency "RxSwift", '~> 5.0'
23+
cs.dependency "RxSwift", '6.0.0'
2424
end
2525

2626
s.subspec "RxCocoa" do |co|
2727
co.source_files = "Source/RxCocoa"
2828
co.frameworks = "Foundation"
29-
co.dependency "RxCocoa", '~> 5.0'
29+
co.dependency "RxCocoa", '6.0.0'
3030
co.dependency "RxSwiftExt/Core"
3131
end
3232
end

RxSwiftExt.xcodeproj/project.pbxproj

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,6 @@
188188
BF515CE91F3F3B0100492640 /* fromAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF515CE11F3F371600492640 /* fromAsync.swift */; };
189189
BF515CEA1F3F3B0300492640 /* curry.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF515CDF1F3F370600492640 /* curry.swift */; };
190190
BF515CEB1F3F3B0300492640 /* curry.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF515CDF1F3F370600492640 /* curry.swift */; };
191-
BF79DA0A206C145D008AA708 /* withUnretained.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA09206C145D008AA708 /* withUnretained.swift */; };
192-
BF79DA0B206C145D008AA708 /* withUnretained.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA09206C145D008AA708 /* withUnretained.swift */; };
193-
BF79DA0C206C145D008AA708 /* withUnretained.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA09206C145D008AA708 /* withUnretained.swift */; };
194-
BF79DA0E206C185B008AA708 /* WithUnretainedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA0D206C185B008AA708 /* WithUnretainedTests.swift */; };
195-
BF79DA0F206C185B008AA708 /* WithUnretainedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA0D206C185B008AA708 /* WithUnretainedTests.swift */; };
196-
BF79DA10206C185B008AA708 /* WithUnretainedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF79DA0D206C185B008AA708 /* WithUnretainedTests.swift */; };
197191
C4D2153F20118A81009804AE /* ofType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4D2153E20118A81009804AE /* ofType.swift */; };
198192
C4D2154220118FB9009804AE /* Observable+OfTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4D2154020118F8B009804AE /* Observable+OfTypeTests.swift */; };
199193
C4D2154320118FB9009804AE /* Observable+OfTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4D2154020118F8B009804AE /* Observable+OfTypeTests.swift */; };
@@ -380,8 +374,6 @@
380374
BF515CDF1F3F370600492640 /* curry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = curry.swift; path = Source/Tools/curry.swift; sourceTree = SOURCE_ROOT; };
381375
BF515CE11F3F371600492640 /* fromAsync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = fromAsync.swift; path = Source/RxSwift/fromAsync.swift; sourceTree = SOURCE_ROOT; };
382376
BF515CE31F3F3AC900492640 /* FromAsyncTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FromAsyncTests.swift; sourceTree = "<group>"; };
383-
BF79DA09206C145D008AA708 /* withUnretained.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = withUnretained.swift; sourceTree = "<group>"; };
384-
BF79DA0D206C185B008AA708 /* WithUnretainedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithUnretainedTests.swift; sourceTree = "<group>"; };
385377
C4D2153E20118A81009804AE /* ofType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ofType.swift; sourceTree = "<group>"; };
386378
C4D2154020118F8B009804AE /* Observable+OfTypeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Observable+OfTypeTests.swift"; sourceTree = "<group>"; };
387379
D7C72A3D1FDC5C5D00EAAAAB /* NwiseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NwiseTests.swift; sourceTree = "<group>"; };
@@ -565,7 +557,6 @@
565557
538607A91E6F334B000361DE /* unwrap.swift */,
566558
58C54402C636BC3C2F36A4ED /* zipWith.swift */,
567559
C4D2153E20118A81009804AE /* ofType.swift */,
568-
BF79DA09206C145D008AA708 /* withUnretained.swift */,
569560
DC612871209E80810053CBB7 /* mapMany.swift */,
570561
A23E148621A9EFC000CD5B2F /* partition.swift */,
571562
);
@@ -605,7 +596,6 @@
605596
538607CA1E6F367A000361DE /* WeakTarget.swift */,
606597
538607CB1E6F367A000361DE /* WeakTests.swift */,
607598
58C54E184069446EDEE748F9 /* ZipWithTest.swift */,
608-
BF79DA0D206C185B008AA708 /* WithUnretainedTests.swift */,
609599
A23E148E21A9F10D00CD5B2F /* PartitionTests.swift */,
610600
);
611601
name = RxSwift;
@@ -1060,7 +1050,6 @@
10601050
53F336E81E70CBF700D35D38 /* distinct+RxCocoa.swift in Sources */,
10611051
A23E148721A9EFC000CD5B2F /* partition.swift in Sources */,
10621052
538607AE1E6F334B000361DE /* ignore.swift in Sources */,
1063-
BF79DA0A206C145D008AA708 /* withUnretained.swift in Sources */,
10641053
BF515CE01F3F370600492640 /* curry.swift in Sources */,
10651054
1958B5F1216768D900CAF1D3 /* unwrap+SharedSequence.swift in Sources */,
10661055
5A1DDEBF1ED58F8600F2E4B1 /* pausableBuffered.swift in Sources */,
@@ -1095,7 +1084,6 @@
10951084
538607EA1E6F36A9000361DE /* PausableTests.swift in Sources */,
10961085
538607E91E6F36A9000361DE /* OnceTests.swift in Sources */,
10971086
A23E149321A9F73500CD5B2F /* PartitionTests+RxCocoa.swift in Sources */,
1098-
BF79DA0E206C185B008AA708 /* WithUnretainedTests.swift in Sources */,
10991087
538607EE1E6F36A9000361DE /* WeakTests.swift in Sources */,
11001088
7819961622844EF800340AF4 /* UIScrollView+reachedBottomTests.swift in Sources */,
11011089
780CB21920A0ED3B00FD3F39 /* ToSortedArrayTests.swift in Sources */,
@@ -1151,7 +1139,6 @@
11511139
62512C681F0EAF850083A89F /* mapTo+RxCocoa.swift in Sources */,
11521140
62512C791F0EAF950083A89F /* retryWithBehavior.swift in Sources */,
11531141
DC612873209E80810053CBB7 /* mapMany.swift in Sources */,
1154-
BF79DA0B206C145D008AA708 /* withUnretained.swift in Sources */,
11551142
A23E148821A9EFC000CD5B2F /* partition.swift in Sources */,
11561143
A23E148C21A9F03600CD5B2F /* partition+RxCocoa.swift in Sources */,
11571144
BF515CE81F3F3B0000492640 /* fromAsync.swift in Sources */,
@@ -1182,7 +1169,6 @@
11821169
62512C8F1F0EB17A0083A89F /* DistinctTests+RxCocoa.swift in Sources */,
11831170
62512C951F0EB1850083A89F /* DistinctTests.swift in Sources */,
11841171
62512CA11F0EB1850083A89F /* UnwrapTests.swift in Sources */,
1185-
BF79DA0F206C185B008AA708 /* WithUnretainedTests.swift in Sources */,
11861172
62512CA31F0EB1850083A89F /* WeakTests.swift in Sources */,
11871173
780CB21A20A0ED3B00FD3F39 /* ToSortedArrayTests.swift in Sources */,
11881174
62512C981F0EB1850083A89F /* IgnoreWhenTests.swift in Sources */,
@@ -1238,7 +1224,6 @@
12381224
E39C41D91F18B086007F2ACD /* mapTo+RxCocoa.swift in Sources */,
12391225
E39C41EA1F18B08A007F2ACD /* retryWithBehavior.swift in Sources */,
12401226
DC612874209E80810053CBB7 /* mapMany.swift in Sources */,
1241-
BF79DA0C206C145D008AA708 /* withUnretained.swift in Sources */,
12421227
A23E148921A9EFC000CD5B2F /* partition.swift in Sources */,
12431228
A23E148D21A9F03600CD5B2F /* partition+RxCocoa.swift in Sources */,
12441229
BF515CE91F3F3B0100492640 /* fromAsync.swift in Sources */,
@@ -1269,7 +1254,6 @@
12691254
E39C42011F18B13E007F2ACD /* CascadeTests.swift in Sources */,
12701255
E39C42101F18B13E007F2ACD /* WeakTarget.swift in Sources */,
12711256
E39C42031F18B13E007F2ACD /* DistinctTests.swift in Sources */,
1272-
BF79DA10206C185B008AA708 /* WithUnretainedTests.swift in Sources */,
12731257
E39C41FD1F18B13A007F2ACD /* DistinctTests+RxCocoa.swift in Sources */,
12741258
780CB21B20A0ED3B00FD3F39 /* ToSortedArrayTests.swift in Sources */,
12751259
E39C42051F18B13E007F2ACD /* IgnoreTests.swift in Sources */,

Source/RxSwift/catchErrorJustComplete.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension ObservableType {
1515
- returns: An observable sequence that never errors and completes when an error occurs in the underlying sequence
1616
*/
1717
public func catchErrorJustComplete() -> Observable<Element> {
18-
return catchError { _ in
18+
return `catch` { _ in
1919
return Observable.empty()
2020
}
2121
}

Source/RxSwift/fromAsync.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public extension PrimitiveSequenceType where Trait == SingleTrait {
8484
case let (.some(result), nil):
8585
single(.success(result))
8686
case let (nil, .some(error)):
87-
single(.error(error))
87+
single(.failure(error))
8888
default:
89-
single(.error(FromAsyncError.inconsistentCompletionResult))
89+
single(.failure(FromAsyncError.inconsistentCompletionResult))
9090
}
9191
}
9292
return Disposables.create()

Source/RxSwift/ignoreErrors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ extension ObservableType {
2727
- returns: An observable sequence that errors only when `predicate` returns `false`
2828
*/
2929
public func ignoreErrors(_ predicate : @escaping (Error) -> Bool) -> Observable<Element> {
30-
return retryWhen {
30+
return retry(when: {
3131
return $0.flatMap { error -> Observable<Bool> in
3232
return predicate(error) ? Observable.just(true) : Observable<Bool>.error(error)
3333
}
34-
}
34+
})
3535
}
3636
}

Source/RxSwift/repeatWithBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension ObservableType {
4949
let conditions = behavior.calculateConditions(currentRepeat)
5050

5151
return concat(Observable.error(RepeatError.catchable))
52-
.catchError {error in
52+
.catch { error in
5353
//if observable errors, forward the error
5454
guard error is RepeatError else {
5555
return Observable.error(error)

Source/RxSwift/retryWithBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extension ObservableType {
8181
// calculate conditions for bahavior
8282
let conditions = behavior.calculateConditions(currentAttempt)
8383

84-
return catchError { error -> Observable<Element> in
84+
return `catch` { error -> Observable<Element> in
8585
// return error if exceeds maximum amount of retries
8686
guard conditions.maxCount > currentAttempt else { return Observable.error(error) }
8787

Source/RxSwift/withUnretained.swift

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)