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

Clean up types accross application #115

Open
cole-adams opened this issue Mar 14, 2023 · 0 comments
Open

Clean up types accross application #115

cole-adams opened this issue Mar 14, 2023 · 0 comments

Comments

@cole-adams
Copy link
Member

          I'm definitely starting to feel like `models.ts` has gotten too bloated right? I think there needs to be some amount of separation of our models based on layers.

AKA: the layer that fetches the data from the DB has a bunch of api (renamed from base) models that are more raw representations of the data, and then in another (or multiple other) files we have the view-layer models that have data processed to look exactly as View classes need them to be.

Put another way, netlify function code should only ever see api models, there should be an intermediate layer that transforms api models to view models, and then View vue classes should only ever use view models.

I think we're mostly almost there, we just happen to do a lot of this transforming in the netlify functions right now, and sharing all the types in one models.ts is getting hard to reason about (IMO)

Originally posted by @brian-norman in #113 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant