Spark Javascript is a fast, micro size (256bytes) DOM custom event emitter library. Demo
$ bower install spark-javascript --save
- Distribution file is in the
dist/
directory. - See more: online demo and document
spark(element [object], event [string], data [object][optional]);
Example
document.body.addEventListener('say:hello', function(e){
// print: Object {foo:"bar"}
console.log(e.detail)
});
spark(document.body, 'say:hello', {foo:'bar'});
$ npm start
... and then open a browser and go to http://localhost:8080
$ npm run build
- Rename:
gulp-rename
- Js Minified and mangled:
gulp-uglify
- Preserve license comments:
uglify-save-license
Copyright (c) 2017 Hesam Bayat http://pixudio.com