-
Notifications
You must be signed in to change notification settings - Fork 23
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
Typing /app/src/utils/utils.ts #209
Conversation
First foray into typing, starting with simple stuff. Also adds interfaces for user information, so we should think about - Do we want to primarily use `interface` or `type`? Or do we want to leave it up to developers to choose what they feel is right? - Do we want to put interfaces together with code, or do we want seperate files for them?
Just my 2 cents regarding the questions you raised: AFAIK you want Good summary: https://www.youtube.com/watch?v=zM9UPcIyyhQ Regarding where to put stuff: I'm not a big fan of putting things in their own files because of the way they are declared or something like that. A file per interface or all interfaces in one file or stuff like that makes no sense to me. Types are just variables, and like variables they should be declared as close to their usage as we can get away with. If only a single function needs a type, it should be declared in that function. 🤷♀️ |
It me. But sure, we can do types per default. Will get around to changing that, hopefully. |
Can only do that for `IInfoMe` though, since `extends` can only be used with `interface`.
Instead of typing the response, we can directly type the get request instead, making for a clearer statement of intend
Thought about this and ultimately think that prefixing types with "I" just to make clear that they're types is not helpful anymore in this day and age.
It's in the same file as UserInfo, so ... *shrug*
This pull request has conflicts ☹ |
First foray into typing, starting with simple stuff.
Also adds interfaces for user information, so we should think about
interface
ortype
? Or do we want to leave it up to developers to choose what they feel is right?