mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
Updated build
This commit is contained in:
Vendored
+20
@@ -6855,6 +6855,10 @@ define('events',[],function() {
|
|||||||
return events[eventName];
|
return events[eventName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearEvents(){
|
||||||
|
events = {};
|
||||||
|
}
|
||||||
|
|
||||||
function publishSubscription(subscription, data) {
|
function publishSubscription(subscription, data) {
|
||||||
if (subscription.async) {
|
if (subscription.async) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@@ -6902,6 +6906,22 @@ define('events',[],function() {
|
|||||||
async: async,
|
async: async,
|
||||||
once: true
|
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