diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d29611..6b71bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# 3.1.0 + +## New features + +- Clients can now create instances of the Subscribe type. + +## Source changes + +* [Document Subscription's unsubscribe.](https://github.com/material-motion/indefinite-observable-swift/commit/75ec811a2f4d8d949aa50e9b05de38096eafdb42) (Jeff Verkoeyen) +* [Allow Subscriptions to be created by clients.](https://github.com/material-motion/indefinite-observable-swift/commit/eb8abdf91e572e589586721e998fb392fede252c) (Jeff Verkoeyen) +* [Fixed typo (#8)](https://github.com/material-motion/indefinite-observable-swift/commit/01a4ce9393c02856422ae329ec843227f2bc9490) (Brenton Simpson) + # 3.0.0 There is now a distinction between **connection** and **subscription**. diff --git a/IndefiniteObservable.podspec b/IndefiniteObservable.podspec index b26cd3f..a18e15c 100644 --- a/IndefiniteObservable.podspec +++ b/IndefiniteObservable.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "IndefiniteObservable" s.summary = "IndefiniteObservable is a minimal implementation of Observable with no concept of completion or failure." - s.version = "3.0.0" + s.version = "3.1.0" s.authors = "The Material Motion Authors" s.license = "Apache 2.0" s.homepage = "https://github.com/material-motion/indefinite-observable-swift" diff --git a/Podfile.lock b/Podfile.lock index fa3f8d9..e76cbb9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,8 +1,8 @@ PODS: - CatalogByConvention (2.0.0) - - IndefiniteObservable/examples (3.0.0): + - IndefiniteObservable/examples (3.1.0): - IndefiniteObservable/lib - - IndefiniteObservable/lib (3.0.0) + - IndefiniteObservable/lib (3.1.0) DEPENDENCIES: - CatalogByConvention @@ -15,7 +15,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CatalogByConvention: be55c2263132e4f9f59299ac8a528ee8715b3275 - IndefiniteObservable: 65f2dbdba39fb9c175c99c1cc927bf1dabc7bcc9 + IndefiniteObservable: 8dd88933eb00b0186cdcc665692beba53da34f44 PODFILE CHECKSUM: 3e4cdba95901e07a289159f0c5a8b830ecb1a5c8 diff --git a/src/IndefiniteObservable.swift b/src/IndefiniteObservable.swift index 53bd3fc..04e159d 100644 --- a/src/IndefiniteObservable.swift +++ b/src/IndefiniteObservable.swift @@ -86,10 +86,15 @@ public final class Subscription { unsubscribe() } - init(_ disconnect: @escaping () -> Void) { + public init(_ disconnect: @escaping () -> Void) { self.disconnect = disconnect } + /** + Unsubscribing will disconnect all observables from their sources. + + Invoked automatically on deallocation. + */ public func unsubscribe() { disconnect?() disconnect = nil diff --git a/tests/unit/ObservableTests.swift b/tests/unit/ObservableTests.swift index cdc527f..a976076 100644 --- a/tests/unit/ObservableTests.swift +++ b/tests/unit/ObservableTests.swift @@ -94,7 +94,7 @@ class ObservableTests: XCTestCase { waitForExpectations(timeout: 0) } - func testTwoParalellSubscriptions() { + func testTwoParallelSubscriptions() { let value = 10 let observable = ValueObservable { observer in