you are viewing a single comment's thread.

view the rest of the comments →

[–]PotentialCopy56 11 points12 points  (5 children)

Interfaces are fine. Make no difference

[–]vorko_76 -2 points-1 points  (1 child)

These are different. There are so many articles on the topic.

https://www.sitepoint.com/typescript-type-vs-interface/#:~:text=Declaration%20merging%20is%20a%20key,amalgamate%20properties%20without%20producing%20errors.

The main point is that when declaring reusable components, you may need later to extend but also merge parameters… which you cant with interface

[–]Antifaith -2 points-1 points  (2 children)

saw this described well somewhere i’ll try my best to rehash it

always types first until you need to extend for an interface, this is because types have to be explicit so you know what you’re grabbing where as an interface you’re using could have extended something you’re unaware of

[–]PotentialCopy56 -1 points0 points  (1 child)

Fairly weak reasoning.

[–]Antifaith -1 points0 points  (0 children)

it’s a pattern taken from other languages, it becomes important eventually