IIdentifiable<K>

Interface used to create data objects that can be uniquely idendified by an ID.

Description

The IIdentifiable interface is used to create data objects that can be uniquely idendified by an ID.

Important points

  • The type specified in the interface defines the type of the ID field.

Fields

id

Unique object identifier of type K.

id: K

Examples

export class MyData implements IIdentifiable<string> {
    public id: string;
    public field1: string;
    public field2: number; 
    ...
}