<script src="./dist/spark.min.js"></script>
// attach an event listener element.addEventListener('event', function(e){ // print: Object {foo:"bar"} console.log(e.detail) }); // trigger the event spark(element, 'event', {foo:'bar'});
spark(element [object], event [string], data [object][optional]);
element
Type: Object
The DOM element specified to dispatche either a native or custom event at.
event
Type: String
Either a native or custom event to dispatche at the specified target.
data
Type: Any
A CustomEventInit dictionary, optional and defaulting to null, that is an event-dependent value associated with the event.