Skip to content

Commit

Permalink
Removed CancellableBag
Browse files Browse the repository at this point in the history
  • Loading branch information
tcldr committed May 8, 2020
1 parent 2cbad33 commit 9b3514f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 89 deletions.
1 change: 0 additions & 1 deletion Assets/Entwine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ _Entwine Utilities_ are a collection of operators, tools and extensions to make
- The `ReplaySubject` makes it simple for subscribers to receive the most recent values immediately upon subscription.
- The `withLatest(from:)` operator enables state to be taken alongside UI events.
- `Publishers.Factory` makes creating publishers fast and simple – they can even be created inline!
- `CancellableBag` helps to gather all your cancellable in a single place and helps to make your publisher chain declarations even clearer.

be sure to checkout the [documentation](http://tcldr.github.io/Entwine/EntwineDocs) for the full list of operators and utilities.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Entwine
// https://github.com/tcldr/Entwine
//
//
// Copyright © 2019 Tristan Celder. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -25,6 +25,7 @@
import Combine

/// A container for cancellables that will be cancelled when the bag is deallocated or cancelled itself
@available(*, deprecated, message: "Replace with mutable Set<AnyCancellable>")
public final class CancellableBag: Cancellable {

public init() {}
Expand All @@ -46,8 +47,8 @@ public final class CancellableBag: Cancellable {
// MARK: - Cancellable extension

public extension Cancellable {
/// Adds this cancellable to the passed `CancellationBag`
func cancelled(by cancellationBag: CancellableBag) {
cancellationBag.add(self)
@available(*, deprecated, message: "Replace CancellableBag with Set<AnyCancellable> and use `store(in:)`")
func cancelled(by cancellableBag: CancellableBag) {
cancellableBag.add(self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

@available(*, deprecated, renamed: "CancellableBag")
public typealias CancellationBag = CancellableBag
import Combine

@available(*, deprecated, message: "Replace with mutable Set<AnyCancellable>")
public typealias CancellationBag = Set<AnyCancellable>
82 changes: 0 additions & 82 deletions Tests/EntwineTests/CancellableBagTests.swift

This file was deleted.

0 comments on commit 9b3514f

Please sign in to comment.