{"action":"created","issue":{"url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/796","repository_url":"https://api.github.com/repos/metafizzy/infinite-scroll","labels_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/796/labels{/name}","comments_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/796/comments","events_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/796/events","html_url":"https://github.com/metafizzy/infinite-scroll/issues/796","id":325848561,"node_id":"MDU6SXNzdWUzMjU4NDg1NjE=","number":796,"title":"scrollThreshold not unbound when container is removed from dom","user":{"login":"Enalmada","id":1892132,"node_id":"MDQ6VXNlcjE4OTIxMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/1892132?v=4","gravatar_id":"","url":"https://api.github.com/users/Enalmada","html_url":"https://github.com/Enalmada","followers_url":"https://api.github.com/users/Enalmada/followers","following_url":"https://api.github.com/users/Enalmada/following{/other_user}","gists_url":"https://api.github.com/users/Enalmada/gists{/gist_id}","starred_url":"https://api.github.com/users/Enalmada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enalmada/subscriptions","organizations_url":"https://api.github.com/users/Enalmada/orgs","repos_url":"https://api.github.com/users/Enalmada/repos","events_url":"https://api.github.com/users/Enalmada/events{/privacy}","received_events_url":"https://api.github.com/users/Enalmada/received_events","type":"User","site_admin":false},"labels":[{"id":69814,"node_id":"MDU6TGFiZWw2OTgxNA==","url":"https://api.github.com/repos/metafizzy/infinite-scroll/labels/feature%20request","name":"feature request","color":"0b02e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-23T19:47:55Z","updated_at":"2018-06-02T19:56:45Z","closed_at":null,"author_association":"NONE","body":"I use [pjax](https://github.com/defunkt/jquery-pjax) to swap out parts of the page body content without a full pageload.  When I have a page with infinite scroll on it and then pjax it out with other content, bindings seem to persist.  When I scroll on the new \"page\" that has no infinite scroll on it anymore, I still get \"[InfiniteScroll] scrollThreshold\" in the console.\r\n\r\nSince pjax loads in new content dynamically that may or may not replace existing infinite scroll, handling this manually is undesirable.  infinite-scroll should detect when its container has been removed from the dom and unbind its events.\r\n\r\nTest case: https://s.codepen.io/adam-lane/debug/qYGEbd/XxMVwaZBNeOr\r\n\r\nI am hoping that infinite-scroll could have something like this in it...\r\n```\r\n$('.container').bind('DOMNodeRemoved', function(event) {\r\n    destroy();\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/comments/394113070","html_url":"https://github.com/metafizzy/infinite-scroll/issues/796#issuecomment-394113070","issue_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/796","id":394113070,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDExMzA3MA==","user":{"login":"desandro","id":85566,"node_id":"MDQ6VXNlcjg1NTY2","avatar_url":"https://avatars0.githubusercontent.com/u/85566?v=4","gravatar_id":"","url":"https://api.github.com/users/desandro","html_url":"https://github.com/desandro","followers_url":"https://api.github.com/users/desandro/followers","following_url":"https://api.github.com/users/desandro/following{/other_user}","gists_url":"https://api.github.com/users/desandro/gists{/gist_id}","starred_url":"https://api.github.com/users/desandro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desandro/subscriptions","organizations_url":"https://api.github.com/users/desandro/orgs","repos_url":"https://api.github.com/users/desandro/repos","events_url":"https://api.github.com/users/desandro/events{/privacy}","received_events_url":"https://api.github.com/users/desandro/received_events","type":"User","site_admin":false},"created_at":"2018-06-02T19:56:45Z","updated_at":"2018-06-02T19:56:45Z","author_association":"MEMBER","body":"Straightforward solution is to trigger [`destroy`](https://infinite-scroll.com/api.html#destroy) on the client side on page exit."}}
{"actor":{"display_login":"desandro"}}