diff --git a/event.js b/event.js index 256a4b3..5572c74 100644 --- a/event.js +++ b/event.js @@ -284,12 +284,16 @@ module.PureEvent = object.Constructor('PureEvent', Event, { toString: function(){ return `PureEvent ${this.name}(){}`}, - __init__: function(name, options={}){ + __init__: function(name, func, options={}){ + if(typeof(func) != 'function'){ + options = func + func = undefined } object.parentCall(PureEvent.prototype.__init__, this, name, - function(handle, trigger){ - trigger === module.TRIGGER - || handle(false) }, options) }, + function(handle, trigger, args){ + trigger === module.TRIGGER ? + func && func.call(this, handle, ...args) + : handle(false) }, options) }, }) diff --git a/package.json b/package.json index 2d07fd0..05cc71f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "6.20.2", + "version": "6.20.3", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": {