add-event-listener-delegate
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

add-event-listener-delegate

This is a light-weight library for adding event listeners that can handle delegation. This behaves similar to the jQuery.on() method. The package is meant to be used in a build change with browserify or webpack, that can convert the require/import into code the browser can interpret.

Installation

Add add-event-listener-delegate to your projects package.json and run

npm install
# or
yarn

or use

npm install add-event-listener-delegate --save-dev
# or
yarn add add-event-listener-delegate --dev

to install the package.

Usage

In your javascript use

let addEventListenerDelegate = require('add-event-listener-delegate').default

or

import addEventListenerDelegate from 'add-event-listener-delegate'

If you need to have the function in global namespace use

window.addEventListenerDelegate = addEventListenerDelegate

Package Sidebar

Install

npm i add-event-listener-delegate

Weekly Downloads

1

Version

2.0.2

License

MIT

Unpacked Size

3.53 kB

Total Files

5

Last publish

Collaborators

  • thorbennissen