{"action":"created","issue":{"url":"https://api.github.com/repos/hammerlab/pileup.js/issues/289","labels_url":"https://api.github.com/repos/hammerlab/pileup.js/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/hammerlab/pileup.js/issues/289/comments","events_url":"https://api.github.com/repos/hammerlab/pileup.js/issues/289/events","html_url":"https://github.com/hammerlab/pileup.js/pull/289","id":109156466,"number":289,"title":"Pull in data-canvas from NPM and add pileup.destroy()","user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"armish","id":7809,"avatar_url":"https://avatars.githubusercontent.com/u/7809?v=3","gravatar_id":"","url":"https://api.github.com/users/armish","html_url":"https://github.com/armish","followers_url":"https://api.github.com/users/armish/followers","following_url":"https://api.github.com/users/armish/following{/other_user}","gists_url":"https://api.github.com/users/armish/gists{/gist_id}","starred_url":"https://api.github.com/users/armish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armish/subscriptions","organizations_url":"https://api.github.com/users/armish/orgs","repos_url":"https://api.github.com/users/armish/repos","events_url":"https://api.github.com/users/armish/events{/privacy}","received_events_url":"https://api.github.com/users/armish/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-09-30T18:55:39Z","updated_at":"2015-09-30T20:04:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hammerlab/pileup.js/pulls/289","html_url":"https://github.com/hammerlab/pileup.js/pull/289","diff_url":"https://github.com/hammerlab/pileup.js/pull/289.diff","patch_url":"https://github.com/hammerlab/pileup.js/pull/289.patch"},"body":"The data-canvas change surfaced #268 more aggressively in Chrome on my machine. I believe the source of the flakiness was that some event listeners (e.g. TwoBitDataSource.newdata) were being triggered _after_ the pileup was removed from the DOM. This led to code running in our React components after they were detached, which confused React and led to the `Invariant Violation` errors. I added a `destroy` method which silences the event listeners and detaches the React components from the DOM. This de-flaked the tests on my machine, and hopefully on Travis!\r\n\r\n<!-- Reviewable:start -->\r\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/hammerlab/pileup.js/289)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/hammerlab/pileup.js/issues/comments/144524286","html_url":"https://github.com/hammerlab/pileup.js/pull/289#issuecomment-144524286","issue_url":"https://api.github.com/repos/hammerlab/pileup.js/issues/289","id":144524286,"user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T20:04:35Z","updated_at":"2015-09-30T20:04:35Z","body":"\n\n\n\nReview status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.\n\n---\n\n<sup>**[.flowconfig, line 25 \\[r1\\]](https://reviewable.io:443/reviews/hammerlab/pileup.js/289#-K-UobgD1RQ12j2wG4gX)** ([raw file](https://github.com/hammerlab/pileup.js/blob/e463329e508b1cec18c29908e33d29db4fc5d5c9/.flowconfig#L25)):</sup>\nI changed a `lineTo` to `lineMoo` in a method that took a `DataCanvasRenderingContext2D` and got an error, so I think we're good. It is a little sad that we've both developed an instinct to second-guess Flow :/\n<!-- Reviewable comment -K-UqYjZB_ii4fkYuFcf:1008627372 -->\n\n---\n\n\nComments from the [review on Reviewable.io](https://reviewable.io:443/reviews/hammerlab/pileup.js/289)\n<!-- Sent from Reviewable.io -->\n"}}