Matt Pocock on X: "🔥 TypeScript Tip #11 🔥
Deep partials are SUPER useful and not natively supported by TypeScript. Here, I use one to help with mocking an entity in a (imaginary) test file."
🔥 TypeScript Tip #11 🔥
Deep partials are SUPER useful and not natively supported by TypeScript. Here, I use one to help with mocking an entity in a (imaginary) test file.
🔥 TypeScript Tip #11 🔥
Deep partials are SUPER useful and not natively supported by TypeScript. Here, I use one to help with mocking an entity in a (imaginary) test file.
🔥 TypeScript Tip #10 🔥
Using a crazy trick I picked up from @AndaristRake, you can throw detailed error messages for type checks.
Here, I move a runtime check in a function to the type level, meaning you get a detailed error if you use it wrong.
🔥 TypeScript Tip #12 🔥
Ever wanted just a _bit_ of autocomplete?
Here, we create a TypeScript helped called LooseAutocomplete which gives us autocomplete while also allowing arbitrary values.
Picked up this tip from @GavinRayDev - worth a follow!
Love it, used a similar type but wasnt able to get it working with nested arrays cause i was ignorant of the ternary approach. Do you keep a repo / gist with your tips? that'd be 🔥