Skip to content

Consolidate types #197

Description

@avenmia

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Medium PriorityNice to have that would be done by early May for the state rollout.Tech DebtAn enhancement that needs to be done to the codebase that does not impact functionalitygood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions