From fc11d94c35fc531ce86274589d59005f2e00394d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 28 Oct 2022 14:08:26 +0300 Subject: [PATCH] minor fix... Signed-off-by: Alex A. Naanou --- event.js | 12 ++++++++---- package.json | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) 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": {