tye

tye

Micro Event Delegation Module

Showing:

Popularity

Downloads/wk

2

GitHub Stars

2

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

tye

Micro Event Delegation Module

Usage

// Using browserify
var tye = require('tye');
// or using the bundled file in dist bundled in UMD format
<script src="/path/to/dist/bundle.min.js"></script>

// Bind click event to document.body
tye(document.body).on('click', someFunction);
// Event Delegation:
tye(document.body).on('click', '.my-class', someFunction);

// Remove click binding from '.my-class'
tye(document.body).off('click', '.my-class');
// Remove all click bindings from document.body
tye(document.body).off('click');

Under the Hood

This is a wrapper around addEventListener

That allows for event delegation by using element.matches

Thats it, very simple implementation. 2kb minified

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial