{"action":"closed","issue":{"url":"https://api.github.com/repos/codenameyau/playground/issues/23","labels_url":"https://api.github.com/repos/codenameyau/playground/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/codenameyau/playground/issues/23/comments","events_url":"https://api.github.com/repos/codenameyau/playground/issues/23/events","html_url":"https://github.com/codenameyau/playground/issues/23","id":91540939,"number":23,"title":"Better functional binding of set animation","user":{"login":"codenameyau","id":3826772,"avatar_url":"https://avatars.githubusercontent.com/u/3826772?v=3","gravatar_id":"","url":"https://api.github.com/users/codenameyau","html_url":"https://github.com/codenameyau","followers_url":"https://api.github.com/users/codenameyau/followers","following_url":"https://api.github.com/users/codenameyau/following{/other_user}","gists_url":"https://api.github.com/users/codenameyau/gists{/gist_id}","starred_url":"https://api.github.com/users/codenameyau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codenameyau/subscriptions","organizations_url":"https://api.github.com/users/codenameyau/orgs","repos_url":"https://api.github.com/users/codenameyau/repos","events_url":"https://api.github.com/users/codenameyau/events{/privacy}","received_events_url":"https://api.github.com/users/codenameyau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/codenameyau/playground/labels/core","name":"core","color":"fbca04"},{"url":"https://api.github.com/repos/codenameyau/playground/labels/priority%202:%20high","name":"priority 2: high","color":"FFA04D"}],"state":"closed","locked":false,"assignee":{"login":"codenameyau","id":3826772,"avatar_url":"https://avatars.githubusercontent.com/u/3826772?v=3","gravatar_id":"","url":"https://api.github.com/users/codenameyau","html_url":"https://github.com/codenameyau","followers_url":"https://api.github.com/users/codenameyau/followers","following_url":"https://api.github.com/users/codenameyau/following{/other_user}","gists_url":"https://api.github.com/users/codenameyau/gists{/gist_id}","starred_url":"https://api.github.com/users/codenameyau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codenameyau/subscriptions","organizations_url":"https://api.github.com/users/codenameyau/orgs","repos_url":"https://api.github.com/users/codenameyau/repos","events_url":"https://api.github.com/users/codenameyau/events{/privacy}","received_events_url":"https://api.github.com/users/codenameyau/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-06-28T01:47:49Z","updated_at":"2015-06-28T12:49:29Z","closed_at":"2015-06-28T12:49:29Z","body":"This current method of overriding animation is poorly designed. New proposal:\r\n\r\n```javascript\r\nfunction Playground() {\r\n  this.animation = this.defaultAnimation;\r\n}\r\n\r\nPlayground.prototype.updateScene = function() {\r\n  if (this.renderer.running) {\r\n    window.requestAnimationFrame(this.updateScene.bind(this));\r\n    this.animation();\r\n  }\r\n};\r\n\r\nPlayground.prototype.defaultAnimation = function() {\r\n  this.controls.update();\r\n  this.renderScene();\r\n};\r\n\r\nPlayground.prototype.setAnimation = function(animation) {\r\n  this.animation = animation.bind(this);\r\n};\r\n```"}}