Skip to content

Commit e63a34a

Browse files
author
Alexey Naumov
committed
#88: Compare cancelbag's references in loadable equality
1 parent c53f381 commit e63a34a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CountriesSwiftUI/Utilities/Loadable.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ extension Loadable: Equatable where T: Equatable {
103103
static func == (lhs: Loadable<T>, rhs: Loadable<T>) -> Bool {
104104
switch (lhs, rhs) {
105105
case (.notRequested, .notRequested): return true
106-
case let (.isLoading(lhsV, _), .isLoading(rhsV, _)): return lhsV == rhsV
106+
case let (.isLoading(lhsV, lhsC), .isLoading(rhsV, rhsC)):
107+
return lhsV == rhsV && lhsC === rhsC
107108
case let (.loaded(lhsV), .loaded(rhsV)): return lhsV == rhsV
108109
case let (.failed(lhsE), .failed(rhsE)):
109110
return lhsE.localizedDescription == rhsE.localizedDescription

0 commit comments

Comments
 (0)