JM Santos
Feb 25, 2024

--

Hi! Thanks for checking 🚀

Are you saying why not have a file that exports a bunch of functions (addOne, getOne, etc) instead of putting them on a single scope such as a class?

I think it's more like a matter of personal preference.

I prefer only to import a single module rather than multiple ones so that I can take advantage of more of the typings or the "namespace" it provides. When I type `ProductApi.` it gives me all the available methods I can publicly use.

I don't plan to have multiple instances, hence the static identifier.

Thanks for your insights!

--

--

JM Santos
JM Santos

Responses (2)