Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

github.helpers.events will no longer return duplicate events.

This is not accurate to the API.
  • Loading branch information...
commit 58476160f94b06e0afc3d74a18a9a9d4c75adb86 1 parent e8f4800
authored April 19, 2012

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  github/extensions/helpers/helpers.js
7  github/extensions/helpers/helpers.js
@@ -7,19 +7,22 @@
7 7
     // Requires a github user name and an event type.
8 8
     //
9 9
     // This method should take into account for duplicate
10  
-    // watch events of the same repo
  10
+    // watch events of the same repo.
11 11
     //
12 12
     // Option parameters:
13 13
     // limit
  14
+
14 15
     github.helpers.events = function(user, type, options) {
15 16
         var deferred = new github.utils.deferred(),
16 17
             promise = deferred.promise(),
17 18
             events = [],
  19
+            captured = {},
18 20
             found = 0,
19 21
             limit = options.limit || Infinity;
20 22
 
21 23
         github.users(user + '/events').until2(function (item) {
22  
-            if(item.type === type){
  24
+            if(item.type === type && !captured.hasOwnProperty(item.repo.name)){
  25
+                captured[item.repo.name] = true;
23 26
                 events.push(item);
24 27
                 found++;
25 28
             }

0 notes on commit 5847616

Please sign in to comment.
Something went wrong with that request. Please try again.