Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate types #197

Open
avenmia opened this issue Mar 16, 2024 · 0 comments
Open

Consolidate types #197

avenmia opened this issue Mar 16, 2024 · 0 comments
Labels
good first issue Good for newcomers Medium Priority Nice to have that would be done by early May for the state rollout. Tech Debt An enhancement that needs to be done to the codebase that does not impact functionality

Comments

@avenmia
Copy link
Collaborator

avenmia commented Mar 16, 2024

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

@avenmia avenmia added good first issue Good for newcomers Medium Priority Nice to have that would be done by early May for the state rollout. Tech Debt An enhancement that needs to be done to the codebase that does not impact functionality labels Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Medium Priority Nice to have that would be done by early May for the state rollout. Tech Debt An enhancement that needs to be done to the codebase that does not impact functionality
Projects
None yet
Development

No branches or pull requests

1 participant