3 ms·
Just out of curiosity, why don't we use node's event emitters to wrap callbacks as promises?
by pspeter3 13y ago
Just out of curiosity, why don't we use node's event emitters to wrap callbacks as promises?
- jkrems 13y agoBecause promises resolve to one value which can be retrieved long after the promise was resolved. This is a fundamentally different approach than EventEmitters. node's streams are the closest thing to "promise meets event emitter" I'm aware of. But maybe I'm missing the point of your question.