Comparing version 3.0.23 to 3.0.24
17
dot.js
@@ -18,2 +18,3 @@ /*global Map Promise Set*/ | ||
dot = r.dot = setup.bind({ fn: emit, r: r }) | ||
dot.add = add.bind({ r: r }) | ||
dot.off = setup.bind({ fn: off, r: r }) | ||
@@ -130,2 +131,18 @@ dot.reset = reset.bind({ r: r }) | ||
// Compose from require or dynamic import. | ||
// | ||
function add(composer) { | ||
var dot = this.r.dot | ||
composer = composer.default || composer | ||
if (composer.then) { | ||
return composer.then(function(_) { | ||
return (_.default.default || _.default)(dot) | ||
}) | ||
} else if (typeof composer === "function") { | ||
return composer(dot) | ||
} | ||
} | ||
// Turn off listener(s) | ||
@@ -132,0 +149,0 @@ // |
{ | ||
"name": "dot-event", | ||
"version": "3.0.23", | ||
"version": "3.0.24", | ||
"description": "Powerful event emitter", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
12917
407