0.1.0 • Published 10 years ago

derby-destroyer v0.1.0

Weekly downloads
7
License
-
Repository
github
Last release
10 years ago

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