{"action":"opened","issue":{"url":"https://api.github.com/repos/bdadam/PubSub/issues/2","repository_url":"https://api.github.com/repos/bdadam/PubSub","labels_url":"https://api.github.com/repos/bdadam/PubSub/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/bdadam/PubSub/issues/2/comments","events_url":"https://api.github.com/repos/bdadam/PubSub/issues/2/events","html_url":"https://github.com/bdadam/PubSub/issues/2","id":326909091,"number":2,"title":"args duplication bug","user":{"login":"xgqfrms","id":7291672,"avatar_url":"https://avatars2.githubusercontent.com/u/7291672?v=4","gravatar_id":"","url":"https://api.github.com/users/xgqfrms","html_url":"https://github.com/xgqfrms","followers_url":"https://api.github.com/users/xgqfrms/followers","following_url":"https://api.github.com/users/xgqfrms/following{/other_user}","gists_url":"https://api.github.com/users/xgqfrms/gists{/gist_id}","starred_url":"https://api.github.com/users/xgqfrms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgqfrms/subscriptions","organizations_url":"https://api.github.com/users/xgqfrms/orgs","repos_url":"https://api.github.com/users/xgqfrms/repos","events_url":"https://api.github.com/users/xgqfrms/events{/privacy}","received_events_url":"https://api.github.com/users/xgqfrms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-28T06:18:21Z","updated_at":"2018-05-28T06:18:21Z","closed_at":null,"author_association":"NONE","body":"# args duplication bug\r\n\r\n```js\r\n\r\nlet PubSub = window.PubSub;\r\n\r\nPubSub.subscribe(\"anEvent\", function(eventName, eventData) {\r\n    console.log(`\\neventName =`, eventName);\r\n    console.log(`eventData =`, eventData);\r\n    console.log(eventData.something);\r\n    console.log(eventData.someOtherThing);\r\n});\r\n\r\n\r\n// args bug\r\nPubSub.subscribe(\"anEvent\", function(eventName, eventData) {\r\n    console.log(`\\neventName =`, eventName);\r\n    // \"anEvent\"\r\n    console.log(eventName.something + 1);\r\n    console.log(eventName.someOtherThing + 3);\r\n});\r\n\r\n\r\nPubSub.subscribe(\"testEvent\", function(eventData) {\r\n    console.log(`\\neventData =`, eventData);\r\n    console.log(eventData.something);\r\n    console.log(eventData.someOtherThing);\r\n});\r\n\r\nsetTimeout(() => {\r\n    PubSub.publish(\r\n        \"anEvent\",// 1 + 2 args\r\n        \"anEvent\",// name\r\n        {\r\n            something: 1,\r\n            someOtherThing: 2\r\n        },// data\r\n    );\r\n    PubSub.publish(\r\n        \"testEvent\", // 1 + 1 args & name\r\n        {\r\n            something: 1,\r\n            someOtherThing: 2\r\n        },// data\r\n    );\r\n}, 1000);\r\n\r\n```\r\n"}}
{"actor":{"display_login":"xgqfrms"}}