{"action":"closed","number":263,"pull_request":{"url":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263","id":83020100,"html_url":"https://github.com/wayfair/tungstenjs/pull/263","diff_url":"https://github.com/wayfair/tungstenjs/pull/263.diff","patch_url":"https://github.com/wayfair/tungstenjs/pull/263.patch","issue_url":"https://api.github.com/repos/wayfair/tungstenjs/issues/263","number":263,"state":"closed","locked":false,"title":"Add a 'complete' event to Backbone View adaptor","user":{"login":"ballercat","id":743990,"avatar_url":"https://avatars.githubusercontent.com/u/743990?v=3","gravatar_id":"","url":"https://api.github.com/users/ballercat","html_url":"https://github.com/ballercat","followers_url":"https://api.github.com/users/ballercat/followers","following_url":"https://api.github.com/users/ballercat/following{/other_user}","gists_url":"https://api.github.com/users/ballercat/gists{/gist_id}","starred_url":"https://api.github.com/users/ballercat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballercat/subscriptions","organizations_url":"https://api.github.com/users/ballercat/orgs","repos_url":"https://api.github.com/users/ballercat/repos","events_url":"https://api.github.com/users/ballercat/events{/privacy}","received_events_url":"https://api.github.com/users/ballercat/received_events","type":"User","site_admin":false},"body":"# Overview\r\n\r\nAdd a `complete` event to BaseView which notifies when all children and nested children have attached and initialized. Knowing when all views have initialized avoids possible race conditions between root view and any nested children. Very useful for things like SPAs and just in general.\r\n\r\n## Problem\r\n\r\nScenario:\r\n* Root view is created. It has many `childViews`\r\n* Root view triggers a single `event` for each child view model via `postInitialize`\r\n* Each child view creates a listener for a model `event` via its own `postInitialize`\r\n\r\n_None of the child views will be able to react to the event. All events are triggered before childView(s) can listen to them._\r\n\r\nThis can be avoided via generous `setTimeout` outside of BaseVew. But you can easily imagine a scenario where this would still be an issue even with large timeout(s). Ultimately none of the workarounds are perfect, because they will rely on how quickly/slowly childViews are postInitialized.\r\n\r\n## Details\r\n\r\n `complete` event should be thought of as:\r\n\r\n > This View is completely initialized and fully interactive\r\n\r\n* `complete` event will allow root views to set data deep inside nested models reliably\r\n* Only one `complete` event (in the root) gets triggered per view tree\r\n* This doesn't effect any current functionality of initializing views.\r\n* Added unit tests for the functionality. All previous tests pass. \r\n* The only important change is to `adaptors/backbone/base_view.js`\r\n","created_at":"2016-08-28T16:23:16Z","updated_at":"2016-09-08T13:32:25Z","closed_at":"2016-09-08T13:32:25Z","merged_at":null,"merge_commit_sha":"6576b34b03d26011ba24e5112333eff78d94d107","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263/commits","review_comments_url":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263/comments","review_comment_url":"https://api.github.com/repos/wayfair/tungstenjs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wayfair/tungstenjs/issues/263/comments","statuses_url":"https://api.github.com/repos/wayfair/tungstenjs/statuses/79c0af1dc54664ac018bf8f9792340d839081c89","head":{"label":"ballercat:add_all_children_initialized_event","ref":"add_all_children_initialized_event","sha":"79c0af1dc54664ac018bf8f9792340d839081c89","user":{"login":"ballercat","id":743990,"avatar_url":"https://avatars.githubusercontent.com/u/743990?v=3","gravatar_id":"","url":"https://api.github.com/users/ballercat","html_url":"https://github.com/ballercat","followers_url":"https://api.github.com/users/ballercat/followers","following_url":"https://api.github.com/users/ballercat/following{/other_user}","gists_url":"https://api.github.com/users/ballercat/gists{/gist_id}","starred_url":"https://api.github.com/users/ballercat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballercat/subscriptions","organizations_url":"https://api.github.com/users/ballercat/orgs","repos_url":"https://api.github.com/users/ballercat/repos","events_url":"https://api.github.com/users/ballercat/events{/privacy}","received_events_url":"https://api.github.com/users/ballercat/received_events","type":"User","site_admin":false},"repo":{"id":66575797,"name":"tungstenjs","full_name":"ballercat/tungstenjs","owner":{"login":"ballercat","id":743990,"avatar_url":"https://avatars.githubusercontent.com/u/743990?v=3","gravatar_id":"","url":"https://api.github.com/users/ballercat","html_url":"https://github.com/ballercat","followers_url":"https://api.github.com/users/ballercat/followers","following_url":"https://api.github.com/users/ballercat/following{/other_user}","gists_url":"https://api.github.com/users/ballercat/gists{/gist_id}","starred_url":"https://api.github.com/users/ballercat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballercat/subscriptions","organizations_url":"https://api.github.com/users/ballercat/orgs","repos_url":"https://api.github.com/users/ballercat/repos","events_url":"https://api.github.com/users/ballercat/events{/privacy}","received_events_url":"https://api.github.com/users/ballercat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ballercat/tungstenjs","description":"Add complete event to Backbone View","fork":true,"url":"https://api.github.com/repos/ballercat/tungstenjs","forks_url":"https://api.github.com/repos/ballercat/tungstenjs/forks","keys_url":"https://api.github.com/repos/ballercat/tungstenjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ballercat/tungstenjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ballercat/tungstenjs/teams","hooks_url":"https://api.github.com/repos/ballercat/tungstenjs/hooks","issue_events_url":"https://api.github.com/repos/ballercat/tungstenjs/issues/events{/number}","events_url":"https://api.github.com/repos/ballercat/tungstenjs/events","assignees_url":"https://api.github.com/repos/ballercat/tungstenjs/assignees{/user}","branches_url":"https://api.github.com/repos/ballercat/tungstenjs/branches{/branch}","tags_url":"https://api.github.com/repos/ballercat/tungstenjs/tags","blobs_url":"https://api.github.com/repos/ballercat/tungstenjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ballercat/tungstenjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ballercat/tungstenjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ballercat/tungstenjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ballercat/tungstenjs/statuses/{sha}","languages_url":"https://api.github.com/repos/ballercat/tungstenjs/languages","stargazers_url":"https://api.github.com/repos/ballercat/tungstenjs/stargazers","contributors_url":"https://api.github.com/repos/ballercat/tungstenjs/contributors","subscribers_url":"https://api.github.com/repos/ballercat/tungstenjs/subscribers","subscription_url":"https://api.github.com/repos/ballercat/tungstenjs/subscription","commits_url":"https://api.github.com/repos/ballercat/tungstenjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ballercat/tungstenjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ballercat/tungstenjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ballercat/tungstenjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ballercat/tungstenjs/contents/{+path}","compare_url":"https://api.github.com/repos/ballercat/tungstenjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ballercat/tungstenjs/merges","archive_url":"https://api.github.com/repos/ballercat/tungstenjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ballercat/tungstenjs/downloads","issues_url":"https://api.github.com/repos/ballercat/tungstenjs/issues{/number}","pulls_url":"https://api.github.com/repos/ballercat/tungstenjs/pulls{/number}","milestones_url":"https://api.github.com/repos/ballercat/tungstenjs/milestones{/number}","notifications_url":"https://api.github.com/repos/ballercat/tungstenjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ballercat/tungstenjs/labels{/name}","releases_url":"https://api.github.com/repos/ballercat/tungstenjs/releases{/id}","deployments_url":"https://api.github.com/repos/ballercat/tungstenjs/deployments","created_at":"2016-08-25T16:40:40Z","updated_at":"2016-08-27T17:18:33Z","pushed_at":"2016-08-28T21:14:41Z","git_url":"git://github.com/ballercat/tungstenjs.git","ssh_url":"git@github.com:ballercat/tungstenjs.git","clone_url":"https://github.com/ballercat/tungstenjs.git","svn_url":"https://github.com/ballercat/tungstenjs","homepage":"","size":7203,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wayfair:master","ref":"master","sha":"2103157db8385d10b5233db762048e0bfa2495c8","user":{"login":"wayfair","id":1065892,"avatar_url":"https://avatars.githubusercontent.com/u/1065892?v=3","gravatar_id":"","url":"https://api.github.com/users/wayfair","html_url":"https://github.com/wayfair","followers_url":"https://api.github.com/users/wayfair/followers","following_url":"https://api.github.com/users/wayfair/following{/other_user}","gists_url":"https://api.github.com/users/wayfair/gists{/gist_id}","starred_url":"https://api.github.com/users/wayfair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wayfair/subscriptions","organizations_url":"https://api.github.com/users/wayfair/orgs","repos_url":"https://api.github.com/users/wayfair/repos","events_url":"https://api.github.com/users/wayfair/events{/privacy}","received_events_url":"https://api.github.com/users/wayfair/received_events","type":"Organization","site_admin":false},"repo":{"id":32032028,"name":"tungstenjs","full_name":"wayfair/tungstenjs","owner":{"login":"wayfair","id":1065892,"avatar_url":"https://avatars.githubusercontent.com/u/1065892?v=3","gravatar_id":"","url":"https://api.github.com/users/wayfair","html_url":"https://github.com/wayfair","followers_url":"https://api.github.com/users/wayfair/followers","following_url":"https://api.github.com/users/wayfair/following{/other_user}","gists_url":"https://api.github.com/users/wayfair/gists{/gist_id}","starred_url":"https://api.github.com/users/wayfair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wayfair/subscriptions","organizations_url":"https://api.github.com/users/wayfair/orgs","repos_url":"https://api.github.com/users/wayfair/repos","events_url":"https://api.github.com/users/wayfair/events{/privacy}","received_events_url":"https://api.github.com/users/wayfair/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wayfair/tungstenjs","description":"","fork":false,"url":"https://api.github.com/repos/wayfair/tungstenjs","forks_url":"https://api.github.com/repos/wayfair/tungstenjs/forks","keys_url":"https://api.github.com/repos/wayfair/tungstenjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wayfair/tungstenjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wayfair/tungstenjs/teams","hooks_url":"https://api.github.com/repos/wayfair/tungstenjs/hooks","issue_events_url":"https://api.github.com/repos/wayfair/tungstenjs/issues/events{/number}","events_url":"https://api.github.com/repos/wayfair/tungstenjs/events","assignees_url":"https://api.github.com/repos/wayfair/tungstenjs/assignees{/user}","branches_url":"https://api.github.com/repos/wayfair/tungstenjs/branches{/branch}","tags_url":"https://api.github.com/repos/wayfair/tungstenjs/tags","blobs_url":"https://api.github.com/repos/wayfair/tungstenjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wayfair/tungstenjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wayfair/tungstenjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/wayfair/tungstenjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wayfair/tungstenjs/statuses/{sha}","languages_url":"https://api.github.com/repos/wayfair/tungstenjs/languages","stargazers_url":"https://api.github.com/repos/wayfair/tungstenjs/stargazers","contributors_url":"https://api.github.com/repos/wayfair/tungstenjs/contributors","subscribers_url":"https://api.github.com/repos/wayfair/tungstenjs/subscribers","subscription_url":"https://api.github.com/repos/wayfair/tungstenjs/subscription","commits_url":"https://api.github.com/repos/wayfair/tungstenjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/wayfair/tungstenjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/wayfair/tungstenjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/wayfair/tungstenjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/wayfair/tungstenjs/contents/{+path}","compare_url":"https://api.github.com/repos/wayfair/tungstenjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wayfair/tungstenjs/merges","archive_url":"https://api.github.com/repos/wayfair/tungstenjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wayfair/tungstenjs/downloads","issues_url":"https://api.github.com/repos/wayfair/tungstenjs/issues{/number}","pulls_url":"https://api.github.com/repos/wayfair/tungstenjs/pulls{/number}","milestones_url":"https://api.github.com/repos/wayfair/tungstenjs/milestones{/number}","notifications_url":"https://api.github.com/repos/wayfair/tungstenjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wayfair/tungstenjs/labels{/name}","releases_url":"https://api.github.com/repos/wayfair/tungstenjs/releases{/id}","deployments_url":"https://api.github.com/repos/wayfair/tungstenjs/deployments","created_at":"2015-03-11T17:41:39Z","updated_at":"2016-08-29T17:12:28Z","pushed_at":"2016-09-08T13:23:07Z","git_url":"git://github.com/wayfair/tungstenjs.git","ssh_url":"git@github.com:wayfair/tungstenjs.git","clone_url":"https://github.com/wayfair/tungstenjs.git","svn_url":"https://github.com/wayfair/tungstenjs","homepage":null,"size":3969,"stargazers_count":171,"watchers_count":171,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"open_issues_count":19,"forks":30,"open_issues":19,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263"},"html":{"href":"https://github.com/wayfair/tungstenjs/pull/263"},"issue":{"href":"https://api.github.com/repos/wayfair/tungstenjs/issues/263"},"comments":{"href":"https://api.github.com/repos/wayfair/tungstenjs/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/wayfair/tungstenjs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wayfair/tungstenjs/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/wayfair/tungstenjs/statuses/79c0af1dc54664ac018bf8f9792340d839081c89"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":12,"additions":184,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"ballercat"}}