Skip to content

on-the-ground/effect-ive-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Effect-ive JavaScript

The effect-ive javascript mascot

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.


🧠 Philosophy

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.


πŸ”§ Packages

  • @on-the-ground/effect
    Structured async effects, contextualized with AbortSignal.
    Composable effect scopes with withEffectHandler, performEffect, and more.
  • @on-the-ground/effect-raise
    Declarative control flow: raise, resume, and recover errors in context-aware, type-safe fashion.

βœ… Key Features

  • βœ… 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

πŸ“ Monorepo Structure

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.


πŸš€ Quick Start

npm install @on-the-ground/effect

Then compose effect scopes like:

await withAbortiveEffectHandler(
    withSignal(signal, {}),
    "log",
    async (signal, msg: string) => console.log(msg),
    async (ctx) => {
        await abortEffect(ctx, "log", "Hello, effect!");
    }
);
```

---

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published