Effection Logo
Effection Logo

Effection

Structured Concurrency and Effects for JavaScript

Latest video

Watch Charles Lowell, the creator of Effection, explain Effection and answer frequenty asked questions.

Stop worrying about asynchrony

Effection gives you control over asyncronous operations with Structured Concurrency guarantees. We ensure that all asyncronous operations are well behaved so you can focus on using async instead of managing it.

🛡️
Leak proof
Effection code cleans up after itself, and that means never having to remember to manually close a resource or detach a listener.
🖐️
Halt any operation
An Effection operation can be shut down at any moment which will not only stop it completely but also stop any other operations that it started.
🔒
Race condition free
Unlike Promises and async/await, Effection is fundamentally synchronous in nature, which means you have full control over the event loop and operations requiring synchronous setup remain race condition free.
🎹
Seamless composition
Since all Effection code is well behaved, it clicks together easily, and there are no nasty surprises when fitting different pieces together.

It's just JavaScript

Effection is a light-weight alternative to async/await with Structured Concurrency guarantees. It only requires adding a few new JavaScript techniques to the knowledge you already have.

😎
Use familiar language constructs
Use let, const, for, while, switch/case and try/catch/finally to write asyncrous operations. They work as you'd expect.
First-class TypeScript Support
Use in TypeScript or JavaScript projects without modifying your build setup. Effection operations can be used and distributed in pure ESM code.
😵‍💫
No esoteric APIs
Small API focused excusively on what you need to gain Structured Concurrency guarantees in JavaScript and nothing else.
Async/Await/Promise alternatives
For every Async/Await/Promise API we provide Structured Concurrency compliant Effection alternative. Checkout our Async Rosetta Stone for translations.
💪
Small but powerful
Everything you need comes in one dependency-free package. At less than 5KB minified and gzipped, Effection can be dropped into any project.
💎
No build step
Use in TypeScript or JavaScript projects without modifying your build setup. Effection operations can be used and distributed in pure ESM code.