Effect
ELI5 — The Vibe Check
Effect is TypeScript's attempt at making errors and side effects impossible to ignore. Every function explicitly declares what can go wrong, what it needs, and what it returns. It's like TypeScript on steroids — incredibly powerful but the learning curve hits like a freight train.
Real Talk
Effect is a TypeScript library for building complex, type-safe applications with structured concurrency, typed errors, dependency injection, and resource management. It provides a functional effect system where computations are described as values, enabling composition, retry logic, and comprehensive error handling at the type level.
Show Me The Code
const getUser = (id: string) =>
Effect.tryPromise({
try: () => db.user.findUnique({ where: { id } }),
catch: () => new UserNotFoundError()
})
const result = await Effect.runPromise(
getUser('1').pipe(Effect.retry({ times: 3 }))
);
When You'll Hear This
"Effect forced us to handle every error path — our app is bulletproof now." / "The Effect learning curve is steep but the type safety is unmatched."
Related Terms
Dependency Injection
Instead of your UserService creating its own DatabaseConnection (tight coupling), you pass the database in from outside: new UserService(db).
Error Handling
Error handling is the art of planning for things to go wrong and dealing with them gracefully instead of letting everything catch fire.
Functional Programming
Functional programming is like cooking with strict rules: no shared bowls, no side dishes contaminating each other, and every dish must be exactly reproduc...
TypeScript
TypeScript is JavaScript with a strict parent watching over it.