News for hackers. Stuff that matters.

ivan7237d

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.

Show HN: With generators/DI, LazyPromise has become a tiny alternative to Effect

https://lazypromise.com/

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...

( Read More... | 1 comment | on HN )
Re:Show HN: LazyPromise = Observable – Signals on Thursday January 01, 2026 @12:21PM (#46455908)
Author here. What's pretty cool about LazyPromise is that when it's paired with Signals, you can do some of the stuff that you'd otherwise do with functional reactive programming, but you don't have to tell your team to learn RxJS or another FRP library - instead there is an API that capitalizes on the existing knowledge of the native promise.
Re:Show HN: LazyPromise = Observable – Signals on Thursday January 01, 2026 @12:14PM (#46455838)
Author here. Good questions.

About the two error channels: what I tried to do is to make it really easy to not use typed errors when you don't need them. In that case your promise is typed as `LazyPromise<Value, never>`.

Signals is a reactive primitive that has been initially introduced in SolidJS framework and have then made their way to other frameworks like Angular.

Re:Show HN: LazyPromise = Observable – Signals on Thursday January 01, 2026 @12:07PM (#46455750)
Yeah, I think this will cover the basic use-case, although the way I'd approach this is by starting with AbortSignal API and then maybe creating a wrapper around it. In a way `eager` and `lazy` functions from LazyPromise library are such wrappers.
Re:Show HN: LazyPromise = Observable – Signals on Thursday January 01, 2026 @11:46AM (#46455522)
Yes, do take a look, I've just added a `log` function that makes it easy to play around with lazy promises and see everything that's going on.
I created a library that lets you log much more information about an RxJS observable than just next/errors/completions. And it's not only about logging to the console: you can inspect log messages in unit tests. Looking forward to your feedback!
Re:Relay Modern: Simpler, faster, more extensible on Wednesday April 19, 2017 @10:19AM (#14147863)
Hey a quick question — which Flow extension are you using? There's the official one called "Flow Language Support" and another one called vscode-flow-ide.

UPD: sorry, I just realized you were talking about Reason, never mind.