I'm new to TypeScript, and working one of my company's repos that uses it heavily. (We're building a React/Redux app.) I'm familiar with the basic concept of TypeScript Generics, but a particular bit of syntax is befuddling. Here's an example of the code in question (it's in a reducer):
interface EntityState<Entity> {
entity?: Entity;
status: ApiStatus; // enum
}
interface FieldSummary {
dataType?: string;
// other properties...
}
function singleField(state: EntityState<FieldSummary> = defaultEntityState,
action: ActionTypes) {...}
Would someone be able to explain what EntityState<FieldSummary> is doing? If further details are needed just let me know.