#typescriptoverloading kết quả tìm kiếm

⚡️ Elegant TypeScript Solutions in Practice! → Union `|` → Conditional `?:` → Intersection `&` → Generics `<T>` → Constraints `extends` → Literals `'exact'` → Optional `?` See it in action 👇 #TypeScript #WebDev #JavaScript

KaraBharat's tweet image. ⚡️ Elegant TypeScript Solutions in Practice!

→ Union `|` 
→ Conditional `?:` 
→ Intersection `&amp;amp;` 
→ Generics `&amp;lt;T&amp;gt;`
→ Constraints `extends` 
→ Literals `&apos;exact&apos;` 
→ Optional `?`

See it in action 👇
#TypeScript #WebDev #JavaScript

Do you want to know how much of your TypeScript code is type-safe? If yes, use type-coverage. Why? See more in 🧵 👇

petarivanovv9's tweet image. Do you want to know how much of your TypeScript code is type-safe?

If yes, use type-coverage.

Why?

See more in 🧵 👇

A cheatsheet with handy TypeScript built-in types

mgechev's tweet image. A cheatsheet with handy TypeScript built-in types

Writing perfect TypeScript types for 3 hours... then fixing one error with as any 💀

OverflowPirates's tweet image. Writing perfect TypeScript types for 3 hours...
then fixing one error with as any 💀

TypeScript Readonly<T>: Shallow Immutability Explained 👇 #TypeScript

KaraBharat's tweet image. TypeScript Readonly&amp;lt;T&amp;gt;: Shallow Immutability Explained 👇

#TypeScript

this is a good example of why it's hard to switch off of @convex_dev In just a few lines of Typescript I get 1) Authentication 2) Authorization 3) App logic which is separate from the implementation of the actual function It's beautiful 🥲

jeffreylemoine's tweet image. this is a good example of why it&apos;s hard to switch off of @convex_dev 

In just a few lines of Typescript I get
1) Authentication 
2) Authorization
3) App logic

which is separate from the implementation of the actual function

It&apos;s beautiful 🥲

TypeScript is all fun and games till you get a 124kb type error...

samwillis's tweet image. TypeScript is all fun and games till you get a 124kb type error...

Turns out it’s possible to implement TypeScript’s type system in TypeScript’s type system 😳 Check out github.com/ronami/HypeScr…

ronenamiel's tweet image. Turns out it’s possible to implement TypeScript’s type system in TypeScript’s type system 😳

Check out github.com/ronami/HypeScr…

Wanna speed up your TypeScript builds and improve your IDE's TypeScript language server performance? Replace type intersections with interfaces. Here's how: 1. Search for this: & { 2. Replace the type intersections with an interface. Why? Because type intersections are slow.…

housecor's tweet image. Wanna speed up your TypeScript builds and improve your IDE&apos;s TypeScript language server performance?

Replace type intersections with interfaces.

Here&apos;s how: 
1. Search for this: &amp;amp; {
2. Replace the type intersections with an interface.

Why? Because type intersections are slow.…

Unpopular opinion, but for real, once you get good with TypeScript, it's hard to go back to JavaScript. TypeScript types feel like a huge upgrade, for example. Fewer bugs in production, the codebase is more scalable. TypeScript --> JavaScript


TypeScript tip: use `as const` after literals to: ‣ Recursively set object properties to readonly ‣ Make arrays readonly tuples ‣ Disable type widening

mgechev's tweet image. TypeScript tip: use `as const` after literals to:
‣ Recursively set object properties to readonly
‣ Make arrays readonly tuples
‣ Disable type widening

Few handy built-in TypeScript types: 🔸 Partial - makes all props of the type parameter optional 🔸 Omit - omits the specified properties in the second type parameter from the first one 🔸 Parameters - gets the parameter types of a function

mgechev's tweet image. Few handy built-in TypeScript types:

🔸 Partial - makes all props of the type parameter optional
🔸 Omit - omits the specified properties in the second type parameter from the first one
🔸 Parameters - gets the parameter types of a function

Nope! Typescript is not a standalone programing language. Typescript is JavaScript with a sprinkle of salt. Even though you write in TS, it must be transpiled(compiled) to JS to get the work done.

Lol. Typescript is a standalone programming language. The current typescript compiler is written in typescript. And if runtime is the issue, there are runtimes that run typescript without compiling it, like Demo and Bun.



🔥 TypeScript Tip #5 🔥 The 'extends' keyword is very powerful in TypeScript. Here, I use it to narrow the value of a generic to enable some beautiful autocomplete/inference.


One of the hardest pills to swallow as a developer: "11" + 1 // "111" "11" - 1 // 10 JavaScript never fails to surprise us with type coercion. Pro Tip: Always be mindful of implicit type coercion and use Number(), String(), or parseInt() explicitly to avoid unexpected results.

99_tikendra's tweet image. One of the hardest pills to swallow as a developer:

&quot;11&quot; + 1 // &quot;111&quot;
&quot;11&quot; - 1 // 10

JavaScript never fails to surprise us with type coercion.

Pro Tip: Always be mindful of implicit type coercion and use Number(), String(), or parseInt() explicitly to avoid unexpected results.

Just found out I can create these files where I put the typescript types/interfaces and never import them! Forget about `import type {}` or relative paths! This approach works well, and all these types are available globally👍

ipwanciu's tweet image. Just found out I can create these files where I put the typescript types/interfaces and never import them!

Forget about `import type {}` or relative paths! This approach works well, and all these types are available globally👍

TypeScript's type system is very powerful because it allows us to express types in terms of other types, including generics I was looking at the implementation of the TS utilities & learned lots about how to implement generics, so I wanted to share my learnings /thread 🧵👇🏾

benmvp's tweet image. TypeScript&apos;s type system is very powerful because it allows us to express types in terms of other types, including generics

I was looking at the implementation of the TS utilities &amp;amp; learned lots about how to implement generics, so I wanted to share my learnings

/thread 🧵👇🏾

Here's a handy guide for understanding some of TypeScript's utility types:

mattpocockuk's tweet image. Here&apos;s a handy guide for understanding some of TypeScript&apos;s utility types:

Problem: You want to know how much of your TypeScript code is type safe. Solution: type-coverage This CLI tool reports the percentage of your code that’s type safe. It reports usage of: 🚩 any 🚩 as assertions (foo as string) 🚩 type assertions (<string>foo) 🚩 Non-null…

housecor's tweet image. Problem: You want to know how much of your TypeScript code is type safe.

Solution: type-coverage

This CLI tool reports the percentage of your code that’s type safe.

It reports usage of:
🚩 any
🚩 as assertions (foo as string)
🚩 type assertions (&amp;lt;string&amp;gt;foo)
🚩 Non-null…

Không có kết quả nào cho "#typescriptoverloading"
Không có kết quả nào cho "#typescriptoverloading"
Không có kết quả nào cho "#typescriptoverloading"
Loading...

Something went wrong.


Something went wrong.


United States Trends