7 ms·
Events, promises and callback functions all work differently, exist in their own lanes and can co-exist in the same library. Each one is perfect in the use case
by peteforde 5y ago
Events, promises and callback functions all work differently, exist in their own lanes and can co-exist in the same library. Each one is perfect in the use case it was designed for.
That said, while promises are a very useful tool, I consistently find events to be an easier mental model to work with in the context of the DOM. This is primarily due to the bubbling nature of events.
It's entirely possible that you and your friends concluded in a bubble that promises are the pattern to rule them all, but don't speak for all of us.