{"action":"closed","number":4,"pull_request":{"url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4","id":44974365,"html_url":"https://github.com/jwmerrill/elm-animation-frame/pull/4","diff_url":"https://github.com/jwmerrill/elm-animation-frame/pull/4.diff","patch_url":"https://github.com/jwmerrill/elm-animation-frame/pull/4.patch","issue_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/4","number":4,"state":"closed","locked":false,"title":"Add a Task which waits for a callback from requestAnimationFrame().","user":{"login":"rgrempel","id":64381,"avatar_url":"https://avatars.githubusercontent.com/u/64381?v=3","gravatar_id":"","url":"https://api.github.com/users/rgrempel","html_url":"https://github.com/rgrempel","followers_url":"https://api.github.com/users/rgrempel/followers","following_url":"https://api.github.com/users/rgrempel/following{/other_user}","gists_url":"https://api.github.com/users/rgrempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rgrempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgrempel/subscriptions","organizations_url":"https://api.github.com/users/rgrempel/orgs","repos_url":"https://api.github.com/users/rgrempel/repos","events_url":"https://api.github.com/users/rgrempel/events{/privacy}","received_events_url":"https://api.github.com/users/rgrempel/received_events","type":"User","site_admin":false},"body":"The purpose of this pull request would be to provide a way to synchronize the execution of a Task with the monitor's frame rate.\r\n\r\nThis is essentially an alternative to using requestAnimationFrame() via a Signal. So, it is useful in cases where one's API is Task-oriented rather than Signal-oriented.\r\n\r\nThe native code included here was inspired by this code in evancz/elm-effects:\r\n\r\nhttps://github.com/evancz/elm-effects/blob/master/src/Native/Effects.js\r\n\r\nHowever, the code here aims to improve upon that code in two ways:\r\n\r\n* The native code in elm-effects is not exposed, so it is not possible for other packages to build on it. (That could be cured if [this pull request](https://github.com/evancz/elm-effects/pull/13) were accepted).\r\n\r\n* The native code in elm-effects is needlessly complex. It takes a function `Time -> Task` as a parameter, in order to be able to do something with the value provided by requestAnimationFrame() in its callback. However, this is, on reflection, unnecessary -- all that is needed is to expose a `Task x Time`, and the clients of this API can supply an `andThen` if they want to do something that depends on the value supplied in the callback. (Or, to put it another way, we don't need to invent a new way of doing composition of Tasks here).\r\n\r\nFor an additional example of using this code, see:\r\n\r\nhttps://github.com/rgrempel/elm-ticker\r\n\r\nNote that I have requested [native review](https://github.com/elm-lang/package.elm-lang.org/issues/71) of that package. However, @laszlopandy sensibly suggested that the necessary code be added here instead, in order to consolidate the required native code in a smaller number of packages. I originally suggested merely [exposing requestAnimationFrame in elm-effects](https://github.com/evancz/elm-effects/pull/13) instead. However, now that I have improved on that code, I would now suggest including that improved version here instead, via this pull request. ","created_at":"2015-09-14T20:08:36Z","updated_at":"2015-09-27T01:43:42Z","closed_at":"2015-09-27T01:43:42Z","merged_at":null,"merge_commit_sha":"18cccacdfde059c35530099821e26b771f7c1e50","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4/commits","review_comments_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4/comments","review_comment_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/4/comments","statuses_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/statuses/63fbec50c33ebce3883c53765094c4d65e40e477","head":{"label":"rgrempel:add-task","ref":"add-task","sha":"63fbec50c33ebce3883c53765094c4d65e40e477","user":{"login":"rgrempel","id":64381,"avatar_url":"https://avatars.githubusercontent.com/u/64381?v=3","gravatar_id":"","url":"https://api.github.com/users/rgrempel","html_url":"https://github.com/rgrempel","followers_url":"https://api.github.com/users/rgrempel/followers","following_url":"https://api.github.com/users/rgrempel/following{/other_user}","gists_url":"https://api.github.com/users/rgrempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rgrempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgrempel/subscriptions","organizations_url":"https://api.github.com/users/rgrempel/orgs","repos_url":"https://api.github.com/users/rgrempel/repos","events_url":"https://api.github.com/users/rgrempel/events{/privacy}","received_events_url":"https://api.github.com/users/rgrempel/received_events","type":"User","site_admin":false},"repo":{"id":42458101,"name":"elm-animation-frame","full_name":"rgrempel/elm-animation-frame","owner":{"login":"rgrempel","id":64381,"avatar_url":"https://avatars.githubusercontent.com/u/64381?v=3","gravatar_id":"","url":"https://api.github.com/users/rgrempel","html_url":"https://github.com/rgrempel","followers_url":"https://api.github.com/users/rgrempel/followers","following_url":"https://api.github.com/users/rgrempel/following{/other_user}","gists_url":"https://api.github.com/users/rgrempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rgrempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgrempel/subscriptions","organizations_url":"https://api.github.com/users/rgrempel/orgs","repos_url":"https://api.github.com/users/rgrempel/repos","events_url":"https://api.github.com/users/rgrempel/events{/privacy}","received_events_url":"https://api.github.com/users/rgrempel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgrempel/elm-animation-frame","description":"An Elm Signal that is synchronized with the monitor's refresh rate.","fork":true,"url":"https://api.github.com/repos/rgrempel/elm-animation-frame","forks_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/forks","keys_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/teams","hooks_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/hooks","issue_events_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/issues/events{/number}","events_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/events","assignees_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/assignees{/user}","branches_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/branches{/branch}","tags_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/tags","blobs_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/statuses/{sha}","languages_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/languages","stargazers_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/stargazers","contributors_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/contributors","subscribers_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/subscribers","subscription_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/subscription","commits_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/issues/comments{/number}","contents_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/contents/{+path}","compare_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/merges","archive_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/downloads","issues_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/issues{/number}","pulls_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/pulls{/number}","milestones_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/milestones{/number}","notifications_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/labels{/name}","releases_url":"https://api.github.com/repos/rgrempel/elm-animation-frame/releases{/id}","created_at":"2015-09-14T15:41:09Z","updated_at":"2015-09-14T15:41:09Z","pushed_at":"2015-09-14T19:47:30Z","git_url":"git://github.com/rgrempel/elm-animation-frame.git","ssh_url":"git@github.com:rgrempel/elm-animation-frame.git","clone_url":"https://github.com/rgrempel/elm-animation-frame.git","svn_url":"https://github.com/rgrempel/elm-animation-frame","homepage":null,"size":129,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jwmerrill:master","ref":"master","sha":"1a99c13f40b235cd8911d50351e63c489c068158","user":{"login":"jwmerrill","id":48409,"avatar_url":"https://avatars.githubusercontent.com/u/48409?v=3","gravatar_id":"","url":"https://api.github.com/users/jwmerrill","html_url":"https://github.com/jwmerrill","followers_url":"https://api.github.com/users/jwmerrill/followers","following_url":"https://api.github.com/users/jwmerrill/following{/other_user}","gists_url":"https://api.github.com/users/jwmerrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jwmerrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwmerrill/subscriptions","organizations_url":"https://api.github.com/users/jwmerrill/orgs","repos_url":"https://api.github.com/users/jwmerrill/repos","events_url":"https://api.github.com/users/jwmerrill/events{/privacy}","received_events_url":"https://api.github.com/users/jwmerrill/received_events","type":"User","site_admin":false},"repo":{"id":26704769,"name":"elm-animation-frame","full_name":"jwmerrill/elm-animation-frame","owner":{"login":"jwmerrill","id":48409,"avatar_url":"https://avatars.githubusercontent.com/u/48409?v=3","gravatar_id":"","url":"https://api.github.com/users/jwmerrill","html_url":"https://github.com/jwmerrill","followers_url":"https://api.github.com/users/jwmerrill/followers","following_url":"https://api.github.com/users/jwmerrill/following{/other_user}","gists_url":"https://api.github.com/users/jwmerrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jwmerrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwmerrill/subscriptions","organizations_url":"https://api.github.com/users/jwmerrill/orgs","repos_url":"https://api.github.com/users/jwmerrill/repos","events_url":"https://api.github.com/users/jwmerrill/events{/privacy}","received_events_url":"https://api.github.com/users/jwmerrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwmerrill/elm-animation-frame","description":"An Elm Signal that is synchronized with the monitor's refresh rate.","fork":false,"url":"https://api.github.com/repos/jwmerrill/elm-animation-frame","forks_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/forks","keys_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/teams","hooks_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/hooks","issue_events_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/events{/number}","events_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/events","assignees_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/assignees{/user}","branches_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/branches{/branch}","tags_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/tags","blobs_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/statuses/{sha}","languages_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/languages","stargazers_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/stargazers","contributors_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/contributors","subscribers_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/subscribers","subscription_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/subscription","commits_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/contents/{+path}","compare_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/merges","archive_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/downloads","issues_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues{/number}","pulls_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls{/number}","milestones_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/milestones{/number}","notifications_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/labels{/name}","releases_url":"https://api.github.com/repos/jwmerrill/elm-animation-frame/releases{/id}","created_at":"2014-11-16T05:19:42Z","updated_at":"2015-07-18T16:31:56Z","pushed_at":"2015-09-14T20:08:36Z","git_url":"git://github.com/jwmerrill/elm-animation-frame.git","ssh_url":"git@github.com:jwmerrill/elm-animation-frame.git","clone_url":"https://github.com/jwmerrill/elm-animation-frame.git","svn_url":"https://github.com/jwmerrill/elm-animation-frame","homepage":null,"size":307,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4"},"html":{"href":"https://github.com/jwmerrill/elm-animation-frame/pull/4"},"issue":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/4"},"comments":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/jwmerrill/elm-animation-frame/statuses/63fbec50c33ebce3883c53765094c4d65e40e477"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":6,"review_comments":0,"commits":1,"additions":93,"deletions":4,"changed_files":4}}