Sandro Maglione

Sandro Maglione

@sandromaglione.bsky.social

The Coding Explorer 💻・Sharing patterns to build type-safe web & mobile apps・Typescript・Effect・React・XState Helping devs at http://typeonce.dev 🚀

172 followers53 following63 posts

Pinned

View full thread

✨ TypeScript tip ✨ A function that returns Tagged Classes 👉 Type a class with `new () => T` 👉 Required `Tag` type and value 👉 Return a class with `_tag` Call the function from `extends` to get the class 🪄

✨ TypeScript Tip ✨ Function overloads with types 👉 Wrap type in `{}` 👉 Provide 2 different signatures Allows to call the same function with different parameters, and different results Runtime problems may apply 🙌 This pattern is useful in library-land to provide a better API for the end user

Programming literacy in this week newsletter 💡 > The ability to read, write, and understand code; programming concepts, syntax, and semantics, as well as applying skills to solve problems and communicate ideas sandromaglione.com/newsletter

sandromaglione.comFirst-draft thoughts on programming, web, games | Sandro MaglioneEvery week I explore the sharp edge of web technologies delivering you unfiltered insights on my discoveries, so you can avoid my same mistakes.

✨ TypeScript Tip ✨ Type classes using `new` 👉 `new` keyword 👉 Constructor parameters inside `()` 👉 Class parameters after `=>` You can mark a type as a constructor signature, something that can be instantiated using `new` 👇

ECS implementation in TypeScript achieved 🫡 TypeScript only, extensible, working with any renderer, type safe and composable 🕹️ May be the beginning of something #game-development #typescript #games #ecs

The expressiveness and elegance of this API is glaring 🤩 👉 No need of explicit input using `flow` 👉 Type safe validation with `decode` 👉 Easy error handling with @EffectTS_ 👉 Type safe SQL query with PGLite and @DrizzleORM Abstraction and safety 🤙

My top 3 skills to learn as a software developer 1️⃣ SQL and relational databases 2️⃣ Domain modeling and data structures 3️⃣ Functional programming This is the topic of this week's newsletter, going over these in practice 👇 sandromaglione.com/newsletter

sandromaglione.comOn a mission to make you a better developer | Sandro MaglioneTimeless coding principles, practices, and tools that make a difference, regardless of your language or framework, delivered in your inbox every week.