Skip to content

Commit b36c285

Browse files
authored
Add function to ignore events
This commit adds a filter function for events that should be ignored, which can be extended later via a commit or a DevTools hack.
1 parent 06e6421 commit b36c285

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

app/public/js/main.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var socket = io(document.location.hostname);
3636
socket.on('github', function (data) {
3737
$('.online-users-count').html(data.connected_users);
3838
data.data.forEach(function(event){
39-
if(!isEventInQueue(event)){
39+
if(!isEventInQueue(event) || shouldEventBeIgnored(event)){
4040
eventQueue.push(event);
4141
}
4242
});
@@ -87,6 +87,16 @@ function isEventInQueue(event){
8787
return false;
8888
}
8989

90+
/**
91+
* This function adds a filter for events that we don't want to hear.
92+
*
93+
* To extend this function, simply add return true for events that should be filtered.
94+
*/
95+
function shouldEventBeIgnored(event){
96+
return false;
97+
}
98+
99+
90100
$(function(){
91101
element = document.documentElement;
92102
drawingArea = document.getElementsByTagName('#area')[0];

0 commit comments

Comments
 (0)