TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

[JavaScript] to promise or to callback? This is the problem

4 pointsby loigeover 9 years ago

1 comment

mchahnover 9 years ago
Hmm. If every library author took the second approach there would be tons of wasted code. This may not be a bad thing but it bothers my OCD.<p>It would be nice if you could write callback-only or promise-only code and have a post-processor produce two .JS files. One with callbacks and one with promises. Then somehow, just as magically, you could require either one. This would save memory and my OCD.