0

Promises seem to be a nice improvement on the callback mechanism. Chaining, error handling, escape from callback-hell, more readable, etc. However, they're meant for asynchronous operations that only happen once. So it doesn't make sense to use promises to deal with a mouseover event where you want to highlight a DOM element whenever someone hovers their mouse over it.

Is there a similar promise-like syntax for repeatable events like the UI event mentioned above?

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
at.
  • 48,358
  • 99
  • 281
  • 447

0 Answers0