Skip to content

Commit

Permalink
#88: Compare cancelbag's references in loadable equality
Browse files Browse the repository at this point in the history
  • Loading branch information
nalexn committed Jun 24, 2023
1 parent c53f381 commit e63a34a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CountriesSwiftUI/Utilities/Loadable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ extension Loadable: Equatable where T: Equatable {
static func == (lhs: Loadable<T>, rhs: Loadable<T>) -> Bool {
switch (lhs, rhs) {
case (.notRequested, .notRequested): return true
case let (.isLoading(lhsV, _), .isLoading(rhsV, _)): return lhsV == rhsV
case let (.isLoading(lhsV, lhsC), .isLoading(rhsV, rhsC)):
return lhsV == rhsV && lhsC === rhsC
case let (.loaded(lhsV), .loaded(rhsV)): return lhsV == rhsV
case let (.failed(lhsE), .failed(rhsE)):
return lhsE.localizedDescription == rhsE.localizedDescription
Expand Down

0 comments on commit e63a34a

Please sign in to comment.