{"action":"created","issue":{"url":"https://api.github.com/repos/rails/turbolinks/issues/604","labels_url":"https://api.github.com/repos/rails/turbolinks/issues/604/labels{/name}","comments_url":"https://api.github.com/repos/rails/turbolinks/issues/604/comments","events_url":"https://api.github.com/repos/rails/turbolinks/issues/604/events","html_url":"https://github.com/rails/turbolinks/pull/604","id":105100913,"number":604,"title":"Delay before showing progress bar","user":{"login":"monkbroc","id":1919681,"avatar_url":"https://avatars.githubusercontent.com/u/1919681?v=3","gravatar_id":"","url":"https://api.github.com/users/monkbroc","html_url":"https://github.com/monkbroc","followers_url":"https://api.github.com/users/monkbroc/followers","following_url":"https://api.github.com/users/monkbroc/following{/other_user}","gists_url":"https://api.github.com/users/monkbroc/gists{/gist_id}","starred_url":"https://api.github.com/users/monkbroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkbroc/subscriptions","organizations_url":"https://api.github.com/users/monkbroc/orgs","repos_url":"https://api.github.com/users/monkbroc/repos","events_url":"https://api.github.com/users/monkbroc/events{/privacy}","received_events_url":"https://api.github.com/users/monkbroc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"javan","id":5355,"avatar_url":"https://avatars.githubusercontent.com/u/5355?v=3","gravatar_id":"","url":"https://api.github.com/users/javan","html_url":"https://github.com/javan","followers_url":"https://api.github.com/users/javan/followers","following_url":"https://api.github.com/users/javan/following{/other_user}","gists_url":"https://api.github.com/users/javan/gists{/gist_id}","starred_url":"https://api.github.com/users/javan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javan/subscriptions","organizations_url":"https://api.github.com/users/javan/orgs","repos_url":"https://api.github.com/users/javan/repos","events_url":"https://api.github.com/users/javan/events{/privacy}","received_events_url":"https://api.github.com/users/javan/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-09-06T15:48:37Z","updated_at":"2015-09-08T03:26:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/turbolinks/pulls/604","html_url":"https://github.com/rails/turbolinks/pull/604","diff_url":"https://github.com/rails/turbolinks/pull/604.diff","patch_url":"https://github.com/rails/turbolinks/pull/604.patch"},"body":"The progress bar makes loading feel slower for fast requests as @javan noted in #581.\r\n\r\nThis PR makes `_updateStyle` a no-op until a set delay has passed (default 400ms).\r\n\r\nThere is another implementation in #593 but it only delays the initial `advanceTo` call, not subsequent ones."},"comment":{"url":"https://api.github.com/repos/rails/turbolinks/issues/comments/138420406","html_url":"https://github.com/rails/turbolinks/pull/604#issuecomment-138420406","issue_url":"https://api.github.com/repos/rails/turbolinks/issues/604","id":138420406,"user":{"login":"monkbroc","id":1919681,"avatar_url":"https://avatars.githubusercontent.com/u/1919681?v=3","gravatar_id":"","url":"https://api.github.com/users/monkbroc","html_url":"https://github.com/monkbroc","followers_url":"https://api.github.com/users/monkbroc/followers","following_url":"https://api.github.com/users/monkbroc/following{/other_user}","gists_url":"https://api.github.com/users/monkbroc/gists{/gist_id}","starred_url":"https://api.github.com/users/monkbroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkbroc/subscriptions","organizations_url":"https://api.github.com/users/monkbroc/orgs","repos_url":"https://api.github.com/users/monkbroc/repos","events_url":"https://api.github.com/users/monkbroc/events{/privacy}","received_events_url":"https://api.github.com/users/monkbroc/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T03:26:26Z","updated_at":"2015-09-08T03:26:26Z","body":"OK. If you think the delay should live somewhere else I can just close this PR.\r\n\r\nMy reasoning for this implementation was to avoid timing issues by keeping the method call sequence the same (`start` --> `advanceTo` --> `done`). If `start` is delayed using `setTimeout` what happens if `done` is called before `start`? The `start` timer will need to be cancelled.\r\n\r\nThe other reason was to keep all the logic related to `ProgressBar` encapsulated. Other code using the class don't need to care if it's delayed or not. Another thought I had was adding an optional parameter to `start` specifying the delay so users could get an immediate or delayed progress bar in their own Javascript."}}