Composable, idiomatic effect handling in TypeScript β with no magic.
Effect-ive TypeScript is a lightweight toolkit for structuring real-world effects in TypeScript
β purely with Promise, AbortSignal, and plain objects.
π« No generator. π« No continuation. π« No framework.
Effect-ive TypeScript is grounded in one principle:
Separate the effect request from the effect handling.
Inspired by Algebraic Effects β but reimagined for the world of Promise.
It brings clarity and testability to async logic, without relying on generator tricks or custom interpreters.
@on-the-ground/effect
Structured async effects, contextualized withAbortSignal.
Composable effect scopes withwithEffectHandler,performEffect, and more.@on-the-ground/effect-raise
Declarative control flow: raise, resume, and recover errors in context-aware, type-safe fashion.
- β No generator or continuation required
- β Purely Promise-based and type-safe
- β Composable effect handlers
- β Abort-safe, cancel-friendly context
- β
No runtime dependency β just TypeScript and
@on-the-ground/daemonizer
packages/
βββ effect β core effect handler (AbortSignal-based)
βββ effect-raise β raise/resume for recoverable control flow
βββ internal β shared internals (not published)
Each package has its own README with full examples.
npm install @on-the-ground/effectThen compose effect scopes like:
await withAbortiveEffectHandler(
withSignal(signal, {}),
"log",
async (signal, msg: string) => console.log(msg),
async (ctx) => {
await abortEffect(ctx, "log", "Hello, effect!");
}
);
```
---