To remove event handlers, the function specified with the addEventListener() method must be an external function.
Anonymous functions will not work.
window.addEventListener returns nothing (making this._offline_listener == undefined), so making this change to use an existing, external function which we can refer to later when destroying the component.
According to W3:
window.addEventListener
returns nothing (makingthis._offline_listener == undefined
), so making this change to use an existing, external function which we can refer to later when destroying the component.I think this works better...