A <a href="http://github.com/ftlabs/ftdomdelegate">ftdomdelegate</a> <a href="http://github.com/ftlabs/fruitmachine">FruitMachine</a> helper.
var Apple = fruitmachinedefinename: 'apple'helpers: require'fruitmachine-ftdomdelegate'thisonButtonClick = thisonButtonClickbindthis;thisdelegateon'click' 'button' thisonButtonClick;thisfire'buttonclick';;
Note: as long as you properly destroy your fruitmachine modules after you're finished with them, you need not worry about detached DOM nodes because dom-delegate will ensure any event listeners added are removed when
destroy is called on it.
There is a rework of the TODO example from the main fruitmachine project.
$ npm install fruitmachine-ftdomdelegate
$ npm install$ npm test
The lead developer of fruitmachine-ftdomdelegate is @matthew-andrews at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.