Third what is third parameter in bean.fire event?

101 views Asked by At

I have recently started working with bean events. I have an issue understanding this line:

bean.fire(this, 'turn', this);

So what I know it says is: execute the bean event with the name 'turn' on the object that is 'this'. Now I am wondering: what is the second this parameter for? I didn't find it in the documentation, it only has two parameters.

Thank you in advance

1

There are 1 answers

0
StuartLC On BEST ANSWER

The third parameter is an optional args array.

From the reference:

An optional args array may be passed to fire() which will in turn be passed to the event handlers. Handlers will be triggered manually, outside of the DOM, even if you're trying to fire standard DOM events.