Comparing version 6.3.0 to 6.3.1
# Changelog | ||
## 6.3.1 | ||
- Fixed issue where subscriptions removed during other callbacks would | ||
invoke missing handler | ||
- Fixed issue where removing a subscription with a different scope | ||
would remove others | ||
## 6.3.0 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "diode", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "A simple event emitter.", | ||
@@ -5,0 +5,0 @@ "main": "src/diode.js", |
@@ -27,7 +27,17 @@ /** | ||
*/ | ||
app.ignore = app.unsubscribe = function (unwanted) { | ||
callbacks = callbacks.filter(function(entry) { | ||
return entry.callback !== unwanted | ||
}) | ||
app.ignore = app.unsubscribe = function (callback, scope) { | ||
var hasScope = arguments.length > 1 | ||
var i = 0 | ||
while (i < callbacks.length) { | ||
var cb = callbacks[i] | ||
if (cb.callback === callback && (!hasScope || cb.scope === scope)) { | ||
callbacks.splice(i, 1) | ||
continue | ||
} | ||
i += 1 | ||
} | ||
return app | ||
@@ -40,3 +50,3 @@ } | ||
app.emit = app.publish = function () { | ||
for (var i = 0, size = callbacks.length; i < size; i++) { | ||
for (var i = 0; i < callbacks.length; i++) { | ||
callbacks[i].callback.apply(callbacks[i].scope, arguments) | ||
@@ -43,0 +53,0 @@ } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24502
11
68