derby-destroyer
v0.1.0
Published
Detects if an element is removed, if so, emits 'destroy' for the component specified.
Downloads
9
Readme
derby-destroyer
derby-destroyer is a simple workaround that emits a destroy
event on the specificed component if the root
element is removed form the DOM. This is a temporary fix until 0.6 implements component destroy events properly, and is a simple attempt at
stopping memory leaks from un-destroyed components.
Usage
CoffeeScript:
exports.create = (model, dom) ->
# component setup code
...
# add destroy emitter to component (note: dom.element('root') is just an example)
require('derby-destroyer')(this, dom.element 'root')
License
MIT