textevents

0.1.0 • Public • Published

ES6 Text Events

Handsomly add events as plain text with textevents.js:

// Use it inline (also using superdom.js, http://superdom.site/)
dom.body.html = `<button ${evt.on.click(e => console.log(e))}>Click me</button>`;
 
// Assign it to a variable and just concatenate to the text
let onclick = evt.on.click(e => console.log(e));
dom.body.html = `<button ${onclick}>Click me</button>`;
 
// Or use event subscriptions
dom.body.html = `<button ${evt.on.click('cta')}>Click me</button>`;
evt.handle('cta', e => console.log(e));

Readme

Keywords

Package Sidebar

Install

npm i textevents

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • franciscop