LazyPromise is a single-shot Observable, a lazy and cancelable promise, and a tiny alternative to Effect.
I actually started LazyPromise without knowing much about Effect (https://www.effect.website/), coming from the world of RxJS and Solid-style signals (my post from last year: https://news.ycombinator.com/item?id=46321852). But Effect is a lazy promise too, and showed how useful generator syntax, type-safe errors and dependency injection can be. So there you go: a version of promise with auto-propagating cancellation and Effect-style features, but essentially the same API as the native promise.
1 comment
ivan7237d8 days ago
As an aside: isn't there something liberating about small primitives like Observable or Signal or a Promise? You're buying into an idea, not an implementation.
Read the full thread on Hacker News →
Related stories
- Hacker News · 1 points · 2 days ago
- Hacker News · 421 points · 6 days ago
- Hacker News · 3 points · 3 days ago
- Hacker News · 1 points · 4 days ago
- Hacker News · 1 points · 6 days ago
- Hacker News · 2 points · about 11 hours ago