1

I want to set a default function for an event of a Class and need to check attached events of Class instance.

As i found out, Events implementations have $events property to store events and i could check it. Is it a better way?

AHHP
  • 2,967
  • 3
  • 33
  • 41
  • 2
    that's pretty much the only thing you can do. its not API but it's there to stay so it is safe to use. you can do `Events.prototype.has = function(type){ return type in this.$events };` then any class with the mixin you can do if (!instance.has('ready')) instance.addEvent('ready', fn);` etc. optional second arg can be an exact callback – Dimitar Christoff Feb 04 '15 at 00:09

0 Answers0