From ff1882279ded929d391ed74ef12107b41cac30a8 Mon Sep 17 00:00:00 2001 From: Taras Nikulin Date: Tue, 28 May 2019 10:40:06 +0200 Subject: [PATCH] Default implementation for isContentEqual --- Sources/Shared/Protocols/ElementRepresentable.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Shared/Protocols/ElementRepresentable.swift b/Sources/Shared/Protocols/ElementRepresentable.swift index 02e0637..176a0de 100644 --- a/Sources/Shared/Protocols/ElementRepresentable.swift +++ b/Sources/Shared/Protocols/ElementRepresentable.swift @@ -31,6 +31,12 @@ public protocol Differentiable { func isContentEqual(to other: Differentiable) -> Bool } +public extension Differentiable { + func isContentEqual(to other: Differentiable) -> Bool { + return self.differenceIdentifier == other.differenceIdentifier + } +} + // MARK: - ElementRepresentable - public protocol ElementRepresentable: Differentiable {