{"action":"created","issue":{"url":"https://api.github.com/repos/meandmax/lory/issues/472","repository_url":"https://api.github.com/repos/meandmax/lory","labels_url":"https://api.github.com/repos/meandmax/lory/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/meandmax/lory/issues/472/comments","events_url":"https://api.github.com/repos/meandmax/lory/issues/472/events","html_url":"https://github.com/meandmax/lory/issues/472","id":185098021,"number":472,"title":"Destroy event not firing","user":{"login":"SukhKalsi","id":10895271,"avatar_url":"https://avatars.githubusercontent.com/u/10895271?v=3","gravatar_id":"","url":"https://api.github.com/users/SukhKalsi","html_url":"https://github.com/SukhKalsi","followers_url":"https://api.github.com/users/SukhKalsi/followers","following_url":"https://api.github.com/users/SukhKalsi/following{/other_user}","gists_url":"https://api.github.com/users/SukhKalsi/gists{/gist_id}","starred_url":"https://api.github.com/users/SukhKalsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SukhKalsi/subscriptions","organizations_url":"https://api.github.com/users/SukhKalsi/orgs","repos_url":"https://api.github.com/users/SukhKalsi/repos","events_url":"https://api.github.com/users/SukhKalsi/events{/privacy}","received_events_url":"https://api.github.com/users/SukhKalsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-25T12:08:53Z","updated_at":"2016-10-25T12:17:50Z","closed_at":null,"body":"Hello\r\n\r\nI'm just wondering what the purpose of the destroy event is for, as it appears from the example that the destroy event does not fire?\r\n\r\nI have the `on.lory.destroy` event listener defined.\r\n\r\n```\r\n class LoryTest {\r\n  \r\n    constructor() {\r\n      const slider = document.querySelector('.js_slider');\r\n      this.attachEvents(slider);\r\n      \r\n      const carousel = lory(slider, {\r\n        infinite: 1,\r\n        enableMouseEvents: true\r\n      });\r\n\r\n      console.log('setup complete.');\r\n\r\n      setTimeout(function() {\r\n        carousel.destroy();\r\n        console.log('carousel should be destroyed');\r\n        console.log(carousel);\r\n      }, 10000);\r\n\r\n    attachEvents(slider) {\r\n      slider.addEventListener('before.lory.init', this.handleEvent.bind(this));\r\n      slider.addEventListener('after.lory.init', this.handleEvent.bind(this));\r\n      slider.addEventListener('before.lory.slide', this.handleEvent.bind(this));\r\n      slider.addEventListener('after.lory.slide', this.handleEvent.bind(this));\r\n\r\n      slider.addEventListener('on.lory.resize', this.handleEvent.bind(this));\r\n      slider.addEventListener('on.lory.touchend', this.handleEvent.bind(this));\r\n      slider.addEventListener('on.lory.touchmove', this.handleEvent.bind(this));\r\n      slider.addEventListener('on.lory.touchstart', this.handleEvent.bind(this));\r\n      slider.addEventListener('on.lory.destroy', this.handleEvent.bind(this));\r\n    }\r\n\r\n    handleEvent(e) {\r\n        var time = new Date();\r\n        time = time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds() + ',' + time.getMilliseconds();\r\n        console.log('[' + time + '] Event dispatched: \"' + e.type + '\"');\r\n    }\r\n  }\r\n```\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/meandmax/lory/issues/comments/256018543","html_url":"https://github.com/meandmax/lory/issues/472#issuecomment-256018543","issue_url":"https://api.github.com/repos/meandmax/lory/issues/472","id":256018543,"user":{"login":"nstanard","id":4204806,"avatar_url":"https://avatars.githubusercontent.com/u/4204806?v=3","gravatar_id":"","url":"https://api.github.com/users/nstanard","html_url":"https://github.com/nstanard","followers_url":"https://api.github.com/users/nstanard/followers","following_url":"https://api.github.com/users/nstanard/following{/other_user}","gists_url":"https://api.github.com/users/nstanard/gists{/gist_id}","starred_url":"https://api.github.com/users/nstanard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nstanard/subscriptions","organizations_url":"https://api.github.com/users/nstanard/orgs","repos_url":"https://api.github.com/users/nstanard/repos","events_url":"https://api.github.com/users/nstanard/events{/privacy}","received_events_url":"https://api.github.com/users/nstanard/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T12:17:50Z","updated_at":"2016-10-25T12:17:50Z","body":"Can you turn that into a working demo using codepen.io?"}}
{"actor":{"display_login":"nstanard"}}