Get started with eventproxy CDN
MIT licensed
EventProxy is a lightweight library for managing and simplifying event dispatching and event handling.
Tags:- event
- task-base
- event machine
- nested callback terminator
Stable version
Copied!
How to start using eventproxy CDN
// Include EventProxy library
const EventProxy = require('eventproxy').EventProxy;
const EventProxyLP = window.EventProxy || window.EventProxyLP; // For older browsers
// Create an instance of EventProxy
const proxy = new EventProxy();
// Define event listeners
proxy.on('button.click', function() {
console.log('Button clicked!');
});
proxy.on('input.change', function(event) {
console.log('Input changed:', event.target.value);
});
// Attach event listeners to elements
const button = document.querySelector('button');
const input = document.querySelector('input');
button.addEventListener('click', proxy.emit.bind(proxy, 'button.click'));
input.addEventListener('change', proxy.emit.bind(proxy, 'input.change'));
Copied!
Copied!
Copied!