Skip to content

Commit

Permalink
Add function to ignore events
Browse files Browse the repository at this point in the history
This commit adds a filter function for events that should be ignored, which can
be extended later via a commit or a DevTools hack.
  • Loading branch information
mcornella committed Oct 5, 2016
1 parent 06e6421 commit b36c285
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/public/js/main.js
Expand Up @@ -36,7 +36,7 @@ var socket = io(document.location.hostname);
socket.on('github', function (data) {
$('.online-users-count').html(data.connected_users);
data.data.forEach(function(event){
if(!isEventInQueue(event)){
if(!isEventInQueue(event) || shouldEventBeIgnored(event)){
eventQueue.push(event);
}
});
Expand Down Expand Up @@ -87,6 +87,16 @@ function isEventInQueue(event){
return false;
}

/**
* This function adds a filter for events that we don't want to hear.
*
* To extend this function, simply add return true for events that should be filtered.
*/
function shouldEventBeIgnored(event){
return false;
}


$(function(){
element = document.documentElement;
drawingArea = document.getElementsByTagName('#area')[0];
Expand Down

0 comments on commit b36c285

Please sign in to comment.