mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Updated build
This commit is contained in:
Vendored
+20
@@ -6855,6 +6855,10 @@ define('events',[],function() {
|
||||
return events[eventName];
|
||||
}
|
||||
|
||||
function clearEvents(){
|
||||
events = {};
|
||||
}
|
||||
|
||||
function publishSubscription(subscription, data) {
|
||||
if (subscription.async) {
|
||||
setTimeout(function() {
|
||||
@@ -6902,6 +6906,22 @@ define('events',[],function() {
|
||||
async: async,
|
||||
once: true
|
||||
});
|
||||
},
|
||||
unsubscribe: function(eventName, callback) {
|
||||
var event;
|
||||
|
||||
if (eventName) {
|
||||
event = getEvent(eventName);
|
||||
if (event && callback) {
|
||||
event.subscribers = event.subscribers.filter(function(subscriber){
|
||||
return subscriber.callback !== callback;
|
||||
});
|
||||
} else {
|
||||
event.subscribers = [];
|
||||
}
|
||||
} else {
|
||||
clearEvents();
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user