{"action":"created","comment":{"url":"https://api.github.com/repos/Gozala/reflex/pulls/comments/62669610","id":62669610,"diff_hunk":"@@ -70,51 +86,63 @@ class Succeed /*::<x,a>*/ extends Task /*::<x, a>*/ {\n   value: a;\n   */\n   constructor(value/*:a*/) {\n-    super(Succeed$prototype$fork)\n+    super()\n     this.value = value\n   }\n   fork(succeed/*:(a:a) => void*/, fail/*:(x:x) => void*/)/*:void*/ {\n     succeed(this.value)\n   }\n }\n-const Succeed$prototype$fork = Succeed.prototype.fork\n \n class Fail /*::<x, a>*/ extends Task /*::<x, a>*/ {\n   /*::\n   error: x;\n   */\n   constructor(error/*:x*/) {\n-    super(Fail$prototype$fork)\n+    super()\n     this.error = error\n   }\n   fork(succeed/*:(a:a) => void*/, fail/*:(x:x) => void*/)/*:void*/ {\n     fail(this.error)\n   }\n }\n-const Fail$prototype$fork = Fail.prototype.fork\n+\n \n class Sleep /*::<x, a:void>*/ extends Task /*::<x, void>*/ {\n   /*::\n   time: Time;\n   */\n   constructor(time/*:Time*/) {\n-    super(Sleep$prototype$execute)\n+    super()\n     this.time = time\n   }\n-  execute(succeed/*:(a:a) => void*/, fail/*:(x:x) => void*/)/*:?Abort<void>*/ {\n-    const id = setTimeout(succeed, this.time, void(0))\n-    return () => clearTimeout(id)\n+  fork(succeed/*:(a:a) => void*/, fail/*:(x:x) => void*/)/*:number*/ {\n+    return setTimeout(succeed, this.time, void(0))\n+  }\n+  abort(id/*:number*/)/*:void*/ {\n+    clearTimeout(id)\n+  }\n+}\n+\n+class RequestAnimationFrame /*::<x>*/ extends Task /*::<x, Time>*/ {","path":"src/task.js","position":123,"original_position":123,"commit_id":"94247d49905c695cb91c435766b694cb827f1aec","original_commit_id":"94247d49905c695cb91c435766b694cb827f1aec","user":{"login":"tschneidereit","id":56359,"avatar_url":"https://avatars.githubusercontent.com/u/56359?v=3","gravatar_id":"","url":"https://api.github.com/users/tschneidereit","html_url":"https://github.com/tschneidereit","followers_url":"https://api.github.com/users/tschneidereit/followers","following_url":"https://api.github.com/users/tschneidereit/following{/other_user}","gists_url":"https://api.github.com/users/tschneidereit/gists{/gist_id}","starred_url":"https://api.github.com/users/tschneidereit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschneidereit/subscriptions","organizations_url":"https://api.github.com/users/tschneidereit/orgs","repos_url":"https://api.github.com/users/tschneidereit/repos","events_url":"https://api.github.com/users/tschneidereit/events{/privacy}","received_events_url":"https://api.github.com/users/tschneidereit/received_events","type":"User","site_admin":false},"body":"I think I'd prefer for this to be called `RequestAnimationFrameTask` or something along those lines (I'd also be ok with `RAFTask`, I suppose). The name being identical to the `requestAnimationFrame` function (which there are two of now, too) is too confusing.","created_at":"2016-05-10T13:22:41Z","updated_at":"2016-05-10T13:22:41Z","html_url":"https://github.com/Gozala/reflex/pull/47#discussion_r62669610","pull_request_url":"https://api.github.com/repos/Gozala/reflex/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/comments/62669610"},"html":{"href":"https://github.com/Gozala/reflex/pull/47#discussion_r62669610"},"pull_request":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/Gozala/reflex/pulls/47","id":69379695,"html_url":"https://github.com/Gozala/reflex/pull/47","diff_url":"https://github.com/Gozala/reflex/pull/47.diff","patch_url":"https://github.com/Gozala/reflex/pull/47.patch","issue_url":"https://api.github.com/repos/Gozala/reflex/issues/47","number":47,"state":"open","locked":false,"title":"Version 0.4","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"body":"## Overview of the changes\r\n\r\n1. Fix regression introduced by 4e13b24 & ba21bbb that cause misbehaviors on synchronous tasks.\r\n2. Factor out `requestAnimationFrame` scheduler from `Effects` library and expose it via tasks instead. Having it part of `Effects` did not really made much sense.\r\n3. Renamed `Effects.task(task)` to `Effects.perform(task)` as former was pretty confusing.\r\n4. Changed API for creating cancellable tasks so they won't perform extra allocations on execution. Most relevant for `requestAnimationFrame` task that are used a lot during animations.\r\n5. Change class hierarchies to avoid passing own methods to super calls.\r\n6. Add `Task.prototype.recover` API so that task failures can more efficiently & intuitively be translated to error actions.","created_at":"2016-05-09T17:20:01Z","updated_at":"2016-05-10T13:22:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8906db5e106ce796f032a640178e493d0e94a260","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Gozala/reflex/pulls/47/commits","review_comments_url":"https://api.github.com/repos/Gozala/reflex/pulls/47/comments","review_comment_url":"https://api.github.com/repos/Gozala/reflex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gozala/reflex/issues/47/comments","statuses_url":"https://api.github.com/repos/Gozala/reflex/statuses/94247d49905c695cb91c435766b694cb827f1aec","head":{"label":"Gozala:dev","ref":"dev","sha":"94247d49905c695cb91c435766b694cb827f1aec","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"repo":{"id":6314638,"name":"reflex","full_name":"Gozala/reflex","owner":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gozala/reflex","description":"Functional reactive UI library","fork":false,"url":"https://api.github.com/repos/Gozala/reflex","forks_url":"https://api.github.com/repos/Gozala/reflex/forks","keys_url":"https://api.github.com/repos/Gozala/reflex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gozala/reflex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gozala/reflex/teams","hooks_url":"https://api.github.com/repos/Gozala/reflex/hooks","issue_events_url":"https://api.github.com/repos/Gozala/reflex/issues/events{/number}","events_url":"https://api.github.com/repos/Gozala/reflex/events","assignees_url":"https://api.github.com/repos/Gozala/reflex/assignees{/user}","branches_url":"https://api.github.com/repos/Gozala/reflex/branches{/branch}","tags_url":"https://api.github.com/repos/Gozala/reflex/tags","blobs_url":"https://api.github.com/repos/Gozala/reflex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gozala/reflex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gozala/reflex/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gozala/reflex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gozala/reflex/statuses/{sha}","languages_url":"https://api.github.com/repos/Gozala/reflex/languages","stargazers_url":"https://api.github.com/repos/Gozala/reflex/stargazers","contributors_url":"https://api.github.com/repos/Gozala/reflex/contributors","subscribers_url":"https://api.github.com/repos/Gozala/reflex/subscribers","subscription_url":"https://api.github.com/repos/Gozala/reflex/subscription","commits_url":"https://api.github.com/repos/Gozala/reflex/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gozala/reflex/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gozala/reflex/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gozala/reflex/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gozala/reflex/contents/{+path}","compare_url":"https://api.github.com/repos/Gozala/reflex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gozala/reflex/merges","archive_url":"https://api.github.com/repos/Gozala/reflex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gozala/reflex/downloads","issues_url":"https://api.github.com/repos/Gozala/reflex/issues{/number}","pulls_url":"https://api.github.com/repos/Gozala/reflex/pulls{/number}","milestones_url":"https://api.github.com/repos/Gozala/reflex/milestones{/number}","notifications_url":"https://api.github.com/repos/Gozala/reflex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gozala/reflex/labels{/name}","releases_url":"https://api.github.com/repos/Gozala/reflex/releases{/id}","deployments_url":"https://api.github.com/repos/Gozala/reflex/deployments","created_at":"2012-10-20T22:53:29Z","updated_at":"2016-05-06T10:55:40Z","pushed_at":"2016-05-09T17:21:13Z","git_url":"git://github.com/Gozala/reflex.git","ssh_url":"git@github.com:Gozala/reflex.git","clone_url":"https://github.com/Gozala/reflex.git","svn_url":"https://github.com/Gozala/reflex","homepage":null,"size":1366,"stargazers_count":211,"watchers_count":211,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":211,"default_branch":"master"}},"base":{"label":"Gozala:master","ref":"master","sha":"1def8368b2b0229cfc1f373e56c30798814ad26a","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"repo":{"id":6314638,"name":"reflex","full_name":"Gozala/reflex","owner":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gozala/reflex","description":"Functional reactive UI library","fork":false,"url":"https://api.github.com/repos/Gozala/reflex","forks_url":"https://api.github.com/repos/Gozala/reflex/forks","keys_url":"https://api.github.com/repos/Gozala/reflex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gozala/reflex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gozala/reflex/teams","hooks_url":"https://api.github.com/repos/Gozala/reflex/hooks","issue_events_url":"https://api.github.com/repos/Gozala/reflex/issues/events{/number}","events_url":"https://api.github.com/repos/Gozala/reflex/events","assignees_url":"https://api.github.com/repos/Gozala/reflex/assignees{/user}","branches_url":"https://api.github.com/repos/Gozala/reflex/branches{/branch}","tags_url":"https://api.github.com/repos/Gozala/reflex/tags","blobs_url":"https://api.github.com/repos/Gozala/reflex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gozala/reflex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gozala/reflex/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gozala/reflex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gozala/reflex/statuses/{sha}","languages_url":"https://api.github.com/repos/Gozala/reflex/languages","stargazers_url":"https://api.github.com/repos/Gozala/reflex/stargazers","contributors_url":"https://api.github.com/repos/Gozala/reflex/contributors","subscribers_url":"https://api.github.com/repos/Gozala/reflex/subscribers","subscription_url":"https://api.github.com/repos/Gozala/reflex/subscription","commits_url":"https://api.github.com/repos/Gozala/reflex/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gozala/reflex/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gozala/reflex/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gozala/reflex/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gozala/reflex/contents/{+path}","compare_url":"https://api.github.com/repos/Gozala/reflex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gozala/reflex/merges","archive_url":"https://api.github.com/repos/Gozala/reflex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gozala/reflex/downloads","issues_url":"https://api.github.com/repos/Gozala/reflex/issues{/number}","pulls_url":"https://api.github.com/repos/Gozala/reflex/pulls{/number}","milestones_url":"https://api.github.com/repos/Gozala/reflex/milestones{/number}","notifications_url":"https://api.github.com/repos/Gozala/reflex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gozala/reflex/labels{/name}","releases_url":"https://api.github.com/repos/Gozala/reflex/releases{/id}","deployments_url":"https://api.github.com/repos/Gozala/reflex/deployments","created_at":"2012-10-20T22:53:29Z","updated_at":"2016-05-06T10:55:40Z","pushed_at":"2016-05-09T17:21:13Z","git_url":"git://github.com/Gozala/reflex.git","ssh_url":"git@github.com:Gozala/reflex.git","clone_url":"https://github.com/Gozala/reflex.git","svn_url":"https://github.com/Gozala/reflex","homepage":null,"size":1366,"stargazers_count":211,"watchers_count":211,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/47"},"html":{"href":"https://github.com/Gozala/reflex/pull/47"},"issue":{"href":"https://api.github.com/repos/Gozala/reflex/issues/47"},"comments":{"href":"https://api.github.com/repos/Gozala/reflex/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gozala/reflex/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/Gozala/reflex/statuses/94247d49905c695cb91c435766b694cb827f1aec"}}}}