Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230078

Making friends out of TypeScript and Vue Developers

$
0
0

My advice is to avoid any as much as humanly possible.

“Unknown” is problematic by definition, but generics do a great job of handling “not completely known”:

“Optional” is easy. You can “or” together union types like string | number, and Foo | undefined is equivalent to "optional Foo". This is such a common construct that there’s syntactic sugar for it: foo?: Foo.

There are also utility types that allow you to turn properties from required to optional (or vice versa) using a more generic syntax.


Viewing all articles
Browse latest Browse all 230078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>