lundi 29 novembre 2021

How do I decide between using a Typescript file and a Svelte file?

My friend uses Typescript and Svelte to make web apps. I asked him how he chooses when something should be a Typescript file, versus when it should be a Svelte file; and he said, "in a svelte file it's code per instance of a component," whereas Typescript is "a regular file...global, one per application."

This makes sense to me logically, but I still can't comprehend when I should use which one. Is it possible to make the SAME exact web app using:

  1. ONLY Typescript files,
  2. ONLY Svelte files, and
  3. a mix of both?

If so, then why is option 3 superior? If not, which options are possible and which options aren't, and why? Better put, what (if anything) can Typescript files do that Svelte files can't, and vice versa?




Aucun commentaire:

Enregistrer un commentaire