{"action":"created","issue":{"url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/42","labels_url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/42/comments","events_url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/42/events","html_url":"https://github.com/christianalfoni/flux-angular/issues/42","id":73692470,"number":42,"title":"Support max listener configuration","user":{"login":"pramodsankarl","id":3045484,"avatar_url":"https://avatars.githubusercontent.com/u/3045484?v=3","gravatar_id":"","url":"https://api.github.com/users/pramodsankarl","html_url":"https://github.com/pramodsankarl","followers_url":"https://api.github.com/users/pramodsankarl/followers","following_url":"https://api.github.com/users/pramodsankarl/following{/other_user}","gists_url":"https://api.github.com/users/pramodsankarl/gists{/gist_id}","starred_url":"https://api.github.com/users/pramodsankarl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pramodsankarl/subscriptions","organizations_url":"https://api.github.com/users/pramodsankarl/orgs","repos_url":"https://api.github.com/users/pramodsankarl/repos","events_url":"https://api.github.com/users/pramodsankarl/events{/privacy}","received_events_url":"https://api.github.com/users/pramodsankarl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-06T18:01:09Z","updated_at":"2015-05-27T13:11:09Z","closed_at":"2015-05-27T07:02:17Z","body":"Hi,\r\n\r\n   When a particular store change is being  listened by more than 10 different places(EventEmitter default limit -`defaultMaxListeners`- is 10), i get the following error from the EventEmitter.\r\n\r\n **(node) warning: possible EventEmitter memory leak detected. 3 listeners added. Use emitter.setMaxListeners() to increase limit.**\r\n\r\nWhich traces down to this comment in the source:\r\n> // By default EventEmitters will print a warning if more than\r\n                // 10 listeners are added to it. This is a useful default which\r\n                // helps finding memory leaks.\r\n                //\r\n                // Obviously not all Emitters should be limited to 10. This function allows\r\n                // that to be increased. Set to zero for unlimited.\r\n\r\nand the configuration is a pretty useful use case i believe.Is there a better way to configure this (other than `this.setMaxListeners(n)` within the store initialize method)? Probably exposing a provider (FluxProvider) function to specify the listener limit for required stores as a dictionary or specifying the settings in the store itself, example:\r\n\r\n    .store('userStore', function(){\r\n      var _user = \"\";\r\n      return{\r\n         maxListeners:20, //Max listeners here or within a generic config key in order to be able to specify any other configuration\r\n         userChanged:function(user){\r\n             _user = user;\r\n             this.emitChange();\r\n          },\r\n        exports:{\r\n          getData:function(){\r\n            return _user;\r\n          }\r\n        },\r\n        handlers:{\r\n          'userChanged':'userChanged'\r\n        }\r\n      }\r\n    });\r\n\r\nand just to fix it in the **[code pen](http://codepen.io/pramodsankarl/pen/QbjBdP)**, i made this change just to showcase in the demo.\r\n\r\n    // Call the constructor of EventEmitter2\r\n     EventEmitter2.call(this, {\r\n        wildcard: true,\r\n       maxListeners: spec.maxListeners\r\n    });\r\n\r\nAppreciate any help on this."},"comment":{"url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/comments/105901031","html_url":"https://github.com/christianalfoni/flux-angular/issues/42#issuecomment-105901031","issue_url":"https://api.github.com/repos/christianalfoni/flux-angular/issues/42","id":105901031,"user":{"login":"christianalfoni","id":3956929,"avatar_url":"https://avatars.githubusercontent.com/u/3956929?v=3","gravatar_id":"","url":"https://api.github.com/users/christianalfoni","html_url":"https://github.com/christianalfoni","followers_url":"https://api.github.com/users/christianalfoni/followers","following_url":"https://api.github.com/users/christianalfoni/following{/other_user}","gists_url":"https://api.github.com/users/christianalfoni/gists{/gist_id}","starred_url":"https://api.github.com/users/christianalfoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianalfoni/subscriptions","organizations_url":"https://api.github.com/users/christianalfoni/orgs","repos_url":"https://api.github.com/users/christianalfoni/repos","events_url":"https://api.github.com/users/christianalfoni/events{/privacy}","received_events_url":"https://api.github.com/users/christianalfoni/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T13:11:09Z","updated_at":"2015-05-27T13:11:09Z","body":"ah crap, I remembered it on the other one though :-D\r\n\r\nBut yeah, I think we are good... you would never set 0 listeners ;-)\r\n\r\nBut will fix it so it will be part of next release. Thanks for pointing it out!"}}