Tag:typescript
All content with the tag "typescript".
TIL: TypeScript Function Overloads
Today I learned about function overloads in TypeScript. They solve a common problem - making your code understand exactly what type comes out based on what type goes in.
Read More→TIL: Powerful Vue.js Patterns for Complex JSON Rendering
Key insights on using provide/inject and recursive components to build a JSON viewer in Vue.js
Read More→How to Implement a Cosine Similarity Function in TypeScript for Vector Comparison
Learn how to build an efficient cosine similarity function in TypeScript for comparing vector embeddings. This step-by-step guide includes code examples, performance optimizations, and practical applications for semantic search and AI recommendation systems
Read More→TypeScript Type Extraction Patterns
Learn powerful TypeScript patterns for extracting and transforming nested types from complex interfaces.
Read More→Better Type Inference with TypeScript Array Filters
How to improve TypeScript type inference when filtering arrays using type guards
Read More→How to Use the Variant Props Pattern in Vue
Learn how to create type-safe Vue components where prop types depend on other props using TypeScript discriminated unions. A practical guide with real-world examples.
Read More→Dynamic Pinia Stores in Vue 3
Create dynamic Pinia stores with unique IDs for separate component instances
Read More→TypeScript Tutorial: Extracting All Keys from Nested Object
Learn how to extract all keys, including nested ones, from TypeScript objects using advanced type manipulation techniques. Improve your TypeScript skills and write safer code.
Read More→TypeScript Snippets in Astro: Show, Don't Tell
Learn how to add interactive type information and syntax highlighting to TypeScript snippets in your Astro site, enhancing code readability and user experience.
Read More→The Problem with as in TypeScript: Why It's a Shortcut We Should Avoid
Learn why as can be a Problem in Typescript
Read More→Exploring the Power of Square Brackets in TypeScript
TypeScript, a statically-typed superset of JavaScript, implements square brackets [] for specific purposes. This post details the essential applications of square brackets in TypeScript, from array types to complex type manipulations, to help you write type-safe code.
Read More→Robust Error Handling in TypeScript: A Journey from Naive to Rust-Inspired Solutions
Learn to write robust, predictable TypeScript code using Rust's Result pattern. This post demonstrates practical examples and introduces the ts-results library, implementing Rust's powerful error management approach in TypeScript.
Read More→Mastering TypeScript: Looping with Types
Did you know that TypeScript is Turing complete? In this post, I will show you how you can loop with TypeScript.
Read More→