Skip to content

Commit 78cee39

Browse files
authored
Add Identifiable to EntityType (#488)
1 parent 8271816 commit 78cee39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/VergeTypedIdentifier/EntityType.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,17 @@ public struct EntityIdentifier<Entity: EntityType> : Hashable, CustomStringConve
4141
}
4242

4343
/// A protocol describes object is an Entity.
44-
public protocol EntityType: Equatable, Sendable {
44+
public protocol EntityType: Identifiable, Equatable, Sendable {
4545

4646
associatedtype EntityIDRawType: Hashable, Sendable
4747

4848
var entityID: EntityID { get }
4949

5050
typealias EntityID = EntityIdentifier<Self>
5151
}
52+
53+
extension EntityType {
54+
public var id: EntityID {
55+
entityID
56+
}
57+
}

0 commit comments

Comments
 (0)