{"action":"created","issue":{"url":"https://api.github.com/repos/stimulusjs/stimulus/issues/160","repository_url":"https://api.github.com/repos/stimulusjs/stimulus","labels_url":"https://api.github.com/repos/stimulusjs/stimulus/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/stimulusjs/stimulus/issues/160/comments","events_url":"https://api.github.com/repos/stimulusjs/stimulus/issues/160/events","html_url":"https://github.com/stimulusjs/stimulus/issues/160","id":327184631,"number":160,"title":"Turbolinks duplicate invoke","user":{"login":"beviz","id":1106312,"avatar_url":"https://avatars2.githubusercontent.com/u/1106312?v=4","gravatar_id":"","url":"https://api.github.com/users/beviz","html_url":"https://github.com/beviz","followers_url":"https://api.github.com/users/beviz/followers","following_url":"https://api.github.com/users/beviz/following{/other_user}","gists_url":"https://api.github.com/users/beviz/gists{/gist_id}","starred_url":"https://api.github.com/users/beviz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beviz/subscriptions","organizations_url":"https://api.github.com/users/beviz/orgs","repos_url":"https://api.github.com/users/beviz/repos","events_url":"https://api.github.com/users/beviz/events{/privacy}","received_events_url":"https://api.github.com/users/beviz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-29T06:26:20Z","updated_at":"2018-05-29T08:29:33Z","closed_at":"2018-05-29T06:46:54Z","author_association":"NONE","body":"A simple test demo, it invoked multiple times `connect` function when Turbolinks changed pages. Is it a bug?\r\n\r\n![stimulus-turoblinks](https://user-images.githubusercontent.com/1106312/40641225-72c5b56a-634b-11e8-8fa8-5823c578e103.gif)\r\n\r\nlayout:\r\n```html\r\n<!doctype html>\r\n<html>\r\n<head>\r\n  <meta charset=\"utf-8\">\r\n  <script src=\"stimulus.js\"></script>\r\n  <script src=\"turblinks.js\"></script>\r\n  <script src=\"start.js\"></script>\r\n<head>\r\n<body>\r\n\r\n</body>\r\n</html>\r\n```\r\n\r\na.html\r\n```html\r\n<div data-controller=\"hello\">\r\n  Page A\r\n</div>\r\n<a href=\"b.html\">B</a>\r\n```\r\n\r\nb.html\r\n\r\n```html\r\n<div data-controller=\"hello\">\r\n  Page B\r\n</div>\r\n<a href=\"a.html\">A</a>\r\n```\r\n\r\nstart.js\r\n\r\n```javascript\r\n(() => {\r\n  const application = Stimulus.Application.start()\r\n\r\n  let count = 0\r\n  application.register(\"hello\", class extends Stimulus.Controller {\r\n    connect() {\r\n      console.log('controller connected', count++)\r\n    }\r\n  })\r\n})()\r\n\r\nTurbolinks.start()\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stimulusjs/stimulus/issues/comments/392695772","html_url":"https://github.com/stimulusjs/stimulus/issues/160#issuecomment-392695772","issue_url":"https://api.github.com/repos/stimulusjs/stimulus/issues/160","id":392695772,"user":{"login":"beviz","id":1106312,"avatar_url":"https://avatars2.githubusercontent.com/u/1106312?v=4","gravatar_id":"","url":"https://api.github.com/users/beviz","html_url":"https://github.com/beviz","followers_url":"https://api.github.com/users/beviz/followers","following_url":"https://api.github.com/users/beviz/following{/other_user}","gists_url":"https://api.github.com/users/beviz/gists{/gist_id}","starred_url":"https://api.github.com/users/beviz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beviz/subscriptions","organizations_url":"https://api.github.com/users/beviz/orgs","repos_url":"https://api.github.com/users/beviz/repos","events_url":"https://api.github.com/users/beviz/events{/privacy}","received_events_url":"https://api.github.com/users/beviz/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T08:29:33Z","updated_at":"2018-05-29T08:29:33Z","author_association":"NONE","body":"Maybe this is the final solution: https://github.com/turbolinks/turbolinks/pull/390"}}
{"actor":{"display_login":"beviz"}}