diff --git a/Classes/Protocols/Identable.swift b/Classes/Protocols/Identable.swift index 2a4c19d..4d14722 100644 --- a/Classes/Protocols/Identable.swift +++ b/Classes/Protocols/Identable.swift @@ -11,11 +11,15 @@ public protocol Identable: Hashable, AnyIdentable { } extension Identable { - func hash(into hasher: inout Hasher) { + public func hash(into hasher: inout Hasher) { hasher.combine(self[keyPath: Self.idKey]) } public func identHash() -> Int { self[keyPath: Self.idKey].hashValue } + + public static func == (lhs: Self, rhs: Self) -> Bool { + lhs.identHash() == rhs.identHash() + } }