Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for events and event handlers to document and HTMLElement #26

Open
prantlf opened this issue Feb 17, 2021 · 1 comment
Open

Comments

@prantlf
Copy link
Contributor

prantlf commented Feb 17, 2021

Would you accept an implementation of Event and EventTarget? It helps using dom-lite in unit tests that add and remove event listeners by calling the DOM API. I have an implementation in 120 LOC.

It could be either added to index.js to be always available, or left outside to be required separately. The separate require would modify prototypes of document and HTMLElement.

const { document } = require('dom-lite')
require('dom-lite/events') // inject the implementation

Adding it to index.js would make the usage easier, providing the small size of the implementation.

What do you think?

@lauriro
Copy link
Member

lauriro commented Feb 18, 2021

Show me the code! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants