Skip to content

Commit

Permalink
Add Identifiable to EntityType (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii authored Jul 13, 2024
1 parent 8271816 commit 78cee39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/VergeTypedIdentifier/EntityType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ public struct EntityIdentifier<Entity: EntityType> : Hashable, CustomStringConve
}

/// A protocol describes object is an Entity.
public protocol EntityType: Equatable, Sendable {
public protocol EntityType: Identifiable, Equatable, Sendable {

associatedtype EntityIDRawType: Hashable, Sendable

var entityID: EntityID { get }

typealias EntityID = EntityIdentifier<Self>
}

extension EntityType {
public var id: EntityID {
entityID
}
}

0 comments on commit 78cee39

Please sign in to comment.