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,753
  • 72
  • 57
  • 129
at.
  • 50,922
  • 104
  • 292
  • 461

0 Answers0