r/javascript • u/Content-Set-1356 • 3d ago
LazyPromise: an async primitive that has familiar semantics of a native promise, but supports auto-propagating cancellation, type-safe errors, and dependency injection
https://lazypromise.com/
4
Upvotes
11
u/femio 3d ago
I'll ask the obvious since I didn't see it in Q&A: what's the functional difference between this and Effect?
•
u/cheers- 12h ago
() => new Promise(executor)Looks lazy enough ;)
2
u/Discordbothost 3d ago
I'd show cancellation with a search box where the user types twice before the first request finishes. A useful example would show both that the first fetch receives an abort signal and that only the second result reaches the UI. Those are two different things I'd want to verify.