This issue is to consolidate types in order to reduce duplication.
For example, as part of the the recent "display pol.is surveys based on demographics questions" feature, I had to update the answer type in several places to include an ID.
ans: { id: string; val: string }
Ideally, this type would be declared in one spot.
interface Answer {
id: string;
val: string;
}
...
ans: Answer
For this issue, document places where types can be consolidated and update the types
References:
https://blog.logrocket.com/types-vs-interfaces-typescript/
https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces
This issue is to consolidate types in order to reduce duplication.
For example, as part of the the recent "display pol.is surveys based on demographics questions" feature, I had to update the answer type in several places to include an ID.
Ideally, this type would be declared in one spot.
For this issue, document places where types can be consolidated and update the types
References:
https://blog.logrocket.com/types-vs-interfaces-typescript/
https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces