{"action":"created","issue":{"url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/3","repository_url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter","labels_url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/3/comments","events_url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/3/events","html_url":"https://github.com/xavi-/node-simple-rate-limiter/pull/3","id":158230406,"number":3,"title":"Function arity changes","user":{"login":"robludwig","id":7698940,"avatar_url":"https://avatars.githubusercontent.com/u/7698940?v=3","gravatar_id":"","url":"https://api.github.com/users/robludwig","html_url":"https://github.com/robludwig","followers_url":"https://api.github.com/users/robludwig/followers","following_url":"https://api.github.com/users/robludwig/following{/other_user}","gists_url":"https://api.github.com/users/robludwig/gists{/gist_id}","starred_url":"https://api.github.com/users/robludwig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robludwig/subscriptions","organizations_url":"https://api.github.com/users/robludwig/orgs","repos_url":"https://api.github.com/users/robludwig/repos","events_url":"https://api.github.com/users/robludwig/events{/privacy}","received_events_url":"https://api.github.com/users/robludwig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-02T20:19:45Z","updated_at":"2016-06-05T18:39:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/pulls/3","html_url":"https://github.com/xavi-/node-simple-rate-limiter/pull/3","diff_url":"https://github.com/xavi-/node-simple-rate-limiter/pull/3.diff","patch_url":"https://github.com/xavi-/node-simple-rate-limiter/pull/3.patch"},"body":"Fixes #2.\r\n\r\nI needed this for a fix of my own. It adds some helpful behavior to the object returned by the rate limiter. It's probably an edge case and not of interest to many but I found it useful.\r\n\r\nTests all pass.\r\nI studied the methodology of [blakeembrey/arity](https://github.com/blakeembrey/arity) in crafting the solution."},"comment":{"url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/comments/223829475","html_url":"https://github.com/xavi-/node-simple-rate-limiter/pull/3#issuecomment-223829475","issue_url":"https://api.github.com/repos/xavi-/node-simple-rate-limiter/issues/3","id":223829475,"user":{"login":"xavi-","id":75434,"avatar_url":"https://avatars.githubusercontent.com/u/75434?v=3","gravatar_id":"","url":"https://api.github.com/users/xavi-","html_url":"https://github.com/xavi-","followers_url":"https://api.github.com/users/xavi-/followers","following_url":"https://api.github.com/users/xavi-/following{/other_user}","gists_url":"https://api.github.com/users/xavi-/gists{/gist_id}","starred_url":"https://api.github.com/users/xavi-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavi-/subscriptions","organizations_url":"https://api.github.com/users/xavi-/orgs","repos_url":"https://api.github.com/users/xavi-/repos","events_url":"https://api.github.com/users/xavi-/events{/privacy}","received_events_url":"https://api.github.com/users/xavi-/received_events","type":"User","site_admin":false},"created_at":"2016-06-05T18:39:31Z","updated_at":"2016-06-05T18:39:31Z","body":"Hello, thanks for the PR.\r\n\r\nPersonal bias, but metaprogramming kinda creeps me out.  That said, I certainly see the value of making sure the function arity is consistent.  Perhaps we could use this technique instead?\r\n\r\n```js\r\nObject.defineProperty(limiter, \"length\", { value: fn.length })\r\n```\r\n\r\nWrote a more detailed explanation here: http://stackoverflow.com/questions/7316688/how-to-programmatically-set-the-length-of-a-function/37645357#37645357\r\n\r\nIt'd be less code and wouldn't require metaprogramming.  The down side is that this trick doesn't work in all versions of node.js which is a bummer.  We'd have to wrap the call in a try/catch to make sure we don't break people's existing code.  What do you think?"}}
{"actor":{"display_login":"xavi-"}}