{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/comments/207729044","pull_request_review_id":143382083,"id":207729044,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzcyOTA0NA==","diff_hunk":"@@ -2,32 +2,32 @@ importance: 5\n \n ---\n \n-# Throttle decorator\n+# 节流装饰器\n \n-Create a \"throttling\" decorator `throttle(f, ms)` -- that returns a wrapper, passing the call to `f` at maximum once per `ms` milliseconds. Those calls that fall into the \"cooldown\" period, are ignored.\n+创建一个“节流”装饰器 `throttle(f, ms)` - 返回一个包装器，每隔 “ms” 毫秒将调用最多传递给 `f` 一次。那些属于“冷却”时期的调用被忽略了。\n \n-**The difference with `debounce` -- if an ignored call is the last during the cooldown, then it executes at the end of the delay.**\n+**与**`debounce` **的区别 - 如果被忽略的调用是冷却期间的最后一次，那么它会在延迟结束时执行。**\n \n-Let's check the real-life application to better understand that requirement and to see where it comes from.\n+让我们检查一下真实应用程序，以便更好地理解这个需求，并了解它的来源。\n \n-**For instance, we want to track mouse movements.**\n+**例如，我们想要跟踪鼠标移动。**\n \n-In browser we can setup a function to run at every mouse micro-movement and get the pointer location as it moves. During an active mouse usage, this function usually runs very frequently, can be something like 100 times per second (every 10 ms).\n+在浏览器中，我们可以设置一个函数来运行每个鼠标微动，并在移动时获取指针位置。在活动鼠标使用期间，此功能通常非常频繁地运行，可以是每秒 100 次（每 10 毫秒）。","path":"1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md","position":20,"original_position":20,"commit_id":"3b44c6603e0ee1e84d24edf4698482509c3310d2","original_commit_id":"3b44c6603e0ee1e84d24edf4698482509c3310d2","user":{"login":"athena0304","id":6672690,"node_id":"MDQ6VXNlcjY2NzI2OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/6672690?v=4","gravatar_id":"","url":"https://api.github.com/users/athena0304","html_url":"https://github.com/athena0304","followers_url":"https://api.github.com/users/athena0304/followers","following_url":"https://api.github.com/users/athena0304/following{/other_user}","gists_url":"https://api.github.com/users/athena0304/gists{/gist_id}","starred_url":"https://api.github.com/users/athena0304/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athena0304/subscriptions","organizations_url":"https://api.github.com/users/athena0304/orgs","repos_url":"https://api.github.com/users/athena0304/repos","events_url":"https://api.github.com/users/athena0304/events{/privacy}","received_events_url":"https://api.github.com/users/athena0304/received_events","type":"User","site_admin":false},"body":"【我们可以设置一个函数来运行每个鼠标微动】=> 【我们可以设置一个函数，鼠标的每次微小的运动都执行】","created_at":"2018-08-05T08:20:31Z","updated_at":"2018-08-05T08:32:44Z","html_url":"https://github.com/xitu/javascript-tutorial-zh/pull/177#discussion_r207729044","pull_request_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/comments/207729044"},"html":{"href":"https://github.com/xitu/javascript-tutorial-zh/pull/177#discussion_r207729044"},"pull_request":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177","id":204594499,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NTk0NDk5","html_url":"https://github.com/xitu/javascript-tutorial-zh/pull/177","diff_url":"https://github.com/xitu/javascript-tutorial-zh/pull/177.diff","patch_url":"https://github.com/xitu/javascript-tutorial-zh/pull/177.patch","issue_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/177","number":177,"state":"open","locked":false,"title":"1-js/06-advanced-functions/09-call-apply-decorators","user":{"login":"lwjcjmx123","id":18714461,"node_id":"MDQ6VXNlcjE4NzE0NDYx","avatar_url":"https://avatars0.githubusercontent.com/u/18714461?v=4","gravatar_id":"","url":"https://api.github.com/users/lwjcjmx123","html_url":"https://github.com/lwjcjmx123","followers_url":"https://api.github.com/users/lwjcjmx123/followers","following_url":"https://api.github.com/users/lwjcjmx123/following{/other_user}","gists_url":"https://api.github.com/users/lwjcjmx123/gists{/gist_id}","starred_url":"https://api.github.com/users/lwjcjmx123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwjcjmx123/subscriptions","organizations_url":"https://api.github.com/users/lwjcjmx123/orgs","repos_url":"https://api.github.com/users/lwjcjmx123/repos","events_url":"https://api.github.com/users/lwjcjmx123/events{/privacy}","received_events_url":"https://api.github.com/users/lwjcjmx123/received_events","type":"User","site_admin":false},"body":"reslove #89","created_at":"2018-07-28T14:04:37Z","updated_at":"2018-08-05T08:32:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8de52ddec0502223b26d4020b4e516220f6320a5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":889535141,"node_id":"MDU6TGFiZWw4ODk1MzUxNDE=","url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/labels/%E6%A0%A1%E5%AF%B9%E8%AE%A4%E9%A2%86","name":"校对认领","color":"7057ff","default":false},{"id":899109746,"node_id":"MDU6TGFiZWw4OTkxMDk3NDY=","url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/labels/%E6%AD%A3%E5%9C%A8%E6%A0%A1%E5%AF%B9","name":"正在校对","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177/commits","review_comments_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177/comments","review_comment_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/177/comments","statuses_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/statuses/3b44c6603e0ee1e84d24edf4698482509c3310d2","head":{"label":"lwjcjmx123:translate/1-js/06-advanced-functions/09-call-apply-decorators","ref":"translate/1-js/06-advanced-functions/09-call-apply-decorators","sha":"3b44c6603e0ee1e84d24edf4698482509c3310d2","user":{"login":"lwjcjmx123","id":18714461,"node_id":"MDQ6VXNlcjE4NzE0NDYx","avatar_url":"https://avatars0.githubusercontent.com/u/18714461?v=4","gravatar_id":"","url":"https://api.github.com/users/lwjcjmx123","html_url":"https://github.com/lwjcjmx123","followers_url":"https://api.github.com/users/lwjcjmx123/followers","following_url":"https://api.github.com/users/lwjcjmx123/following{/other_user}","gists_url":"https://api.github.com/users/lwjcjmx123/gists{/gist_id}","starred_url":"https://api.github.com/users/lwjcjmx123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwjcjmx123/subscriptions","organizations_url":"https://api.github.com/users/lwjcjmx123/orgs","repos_url":"https://api.github.com/users/lwjcjmx123/repos","events_url":"https://api.github.com/users/lwjcjmx123/events{/privacy}","received_events_url":"https://api.github.com/users/lwjcjmx123/received_events","type":"User","site_admin":false},"repo":{"id":141969721,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE5Njk3MjE=","name":"javascript-tutorial-zh","full_name":"lwjcjmx123/javascript-tutorial-zh","owner":{"login":"lwjcjmx123","id":18714461,"node_id":"MDQ6VXNlcjE4NzE0NDYx","avatar_url":"https://avatars0.githubusercontent.com/u/18714461?v=4","gravatar_id":"","url":"https://api.github.com/users/lwjcjmx123","html_url":"https://github.com/lwjcjmx123","followers_url":"https://api.github.com/users/lwjcjmx123/followers","following_url":"https://api.github.com/users/lwjcjmx123/following{/other_user}","gists_url":"https://api.github.com/users/lwjcjmx123/gists{/gist_id}","starred_url":"https://api.github.com/users/lwjcjmx123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwjcjmx123/subscriptions","organizations_url":"https://api.github.com/users/lwjcjmx123/orgs","repos_url":"https://api.github.com/users/lwjcjmx123/repos","events_url":"https://api.github.com/users/lwjcjmx123/events{/privacy}","received_events_url":"https://api.github.com/users/lwjcjmx123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lwjcjmx123/javascript-tutorial-zh","description":"Modern JavaScript Tutorial ","fork":true,"url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh","forks_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/forks","keys_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/teams","hooks_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/hooks","issue_events_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/issues/events{/number}","events_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/events","assignees_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/assignees{/user}","branches_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/branches{/branch}","tags_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/tags","blobs_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/git/refs{/sha}","trees_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/statuses/{sha}","languages_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/languages","stargazers_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/stargazers","contributors_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/contributors","subscribers_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/subscribers","subscription_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/subscription","commits_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/commits{/sha}","git_commits_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/git/commits{/sha}","comments_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/comments{/number}","issue_comment_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/issues/comments{/number}","contents_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/contents/{+path}","compare_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/merges","archive_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/downloads","issues_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/issues{/number}","pulls_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/pulls{/number}","milestones_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/milestones{/number}","notifications_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/labels{/name}","releases_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/releases{/id}","deployments_url":"https://api.github.com/repos/lwjcjmx123/javascript-tutorial-zh/deployments","created_at":"2018-07-23T06:14:19Z","updated_at":"2018-07-23T06:14:23Z","pushed_at":"2018-07-28T14:03:09Z","git_url":"git://github.com/lwjcjmx123/javascript-tutorial-zh.git","ssh_url":"git@github.com:lwjcjmx123/javascript-tutorial-zh.git","clone_url":"https://github.com/lwjcjmx123/javascript-tutorial-zh.git","svn_url":"https://github.com/lwjcjmx123/javascript-tutorial-zh","homepage":"https://javascript.info","size":434558,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"zh-hans"}},"base":{"label":"xitu:zh-hans","ref":"zh-hans","sha":"e04beca55c18515d42c1fee2bf0656cad113d40b","user":{"login":"xitu","id":10482599,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNDgyNTk5","avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":128014656,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwMTQ2NTY=","name":"javascript-tutorial-zh","full_name":"xitu/javascript-tutorial-zh","owner":{"login":"xitu","id":10482599,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNDgyNTk5","avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/javascript-tutorial-zh","description":"Modern JavaScript Tutorial ","fork":true,"url":"https://api.github.com/repos/xitu/javascript-tutorial-zh","forks_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/forks","keys_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/teams","hooks_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/hooks","issue_events_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/events","assignees_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/tags","blobs_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/languages","stargazers_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/stargazers","contributors_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/contributors","subscribers_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/subscribers","subscription_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/subscription","commits_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/merges","archive_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/downloads","issues_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/labels{/name}","releases_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/javascript-tutorial-zh/deployments","created_at":"2018-04-04T06:01:58Z","updated_at":"2018-08-04T11:06:47Z","pushed_at":"2018-08-03T04:24:01Z","git_url":"git://github.com/xitu/javascript-tutorial-zh.git","ssh_url":"git@github.com:xitu/javascript-tutorial-zh.git","clone_url":"https://github.com/xitu/javascript-tutorial-zh.git","svn_url":"https://github.com/xitu/javascript-tutorial-zh","homepage":"https://javascript.info","size":434557,"stargazers_count":29,"watchers_count":29,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":30,"open_issues":45,"watchers":29,"default_branch":"zh-hans"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177"},"html":{"href":"https://github.com/xitu/javascript-tutorial-zh/pull/177"},"issue":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/177"},"comments":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/issues/177/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/pulls/177/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/javascript-tutorial-zh/statuses/3b44c6603e0ee1e84d24edf4698482509c3310d2"}},"author_association":"NONE"}}
{"actor":{"display_login":"athena0304"}}