element-controller
v0.4.0
Published
Simple UI controller with Backbone.js inspired event delegation.
Downloads
15
Maintainers
Readme
ElementController ·
Simple UI controller with Backbone.js inspired event delegation.
Installation
npm install element-controller
Example usage
import ElementController from 'element-controller';
// new CommentController(commentsContainerElement)
export default class CommentController extends ElementController {
getDOMEventHandlerStrings() {
return [
'click .comment > .btn-delete: onDeleteCommentClick',
'focusin .comment: onCommentFocus',
'click .comment: onCommentClick'
];
}
onDeleteCommentClick() {
/* delete handler */
}
onCommentFocus() {
/* focus handler */
}
onCommentClick() {
/* click handler */
}
}
Change log
0.4.0
- Dependency updates
0.3.1
- Bugfix
0.3.0
- Dev env config and dependency updates (eslint, babel, resolve-handlers).
0.2.0
- Updated dependencies
License
This software is licensed under the MIT License.