When an event is dispatched, in the event object there is the Riccio instance and the DroppyNode that relative to the clicked drop-down.
// Print Droppy and DroppyNode instance.
droppy.on('open', function handler (event) {
console.log(event.droppy)
console.log(event.dropdown)
})
However the Droppy instance may be bind to the handler function as contenxt.
// Bind Droppy instance as context.
droppy.on('open', function handler (event) {}, droppy)
This turns useless have the Droppy instance in the event object. Furthermore the handler function has access to the droppy variable from its scope. Should I remove the Droppy instance from the event object?
When an event is dispatched, in the
event
object there is theRiccio
instance and theDroppyNode
that relative to the clicked drop-down.However the
Droppy
instance may be bind to the handler function as contenxt.This turns useless have the
Droppy
instance in theevent
object. Furthermore thehandler
function has access to thedroppy
variable from its scope. Should I remove theDroppy
instance from theevent
object?