UNPKG

@irrelon/emitter

Version:

Simple JavaScript event emitter with some powerful features.

258 lines (83 loc) 3.93 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: deferEmit</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: deferEmit</h1> <section> <header> <h2>deferEmit</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="deferEmit"><span class="type-signature"></span>new deferEmit<span class="signature">(eventName, data<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Queues an event to be fired. This has automatic de-bouncing so that any events of the same type that occur within 100 milliseconds of a previous one will all be wrapped into a single emit rather than emitting tons of events for lots of chained inserts etc. Only the data from the last de-bounced event will be emitted. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>eventName</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">The name of the event to emit.</td> </tr> <tr> <td class="name"><code>data</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Optional data to emit with the event.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Emitter.js.html">Emitter.js</a>, <a href="Emitter.js.html#line716">line 716</a> </li></ul></dd> </dl> </div> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="deferEmit.html">deferEmit</a></li><li><a href="global.html#emit">emit</a></li><li><a href="emitStatic.html">emitStatic</a></li><li><a href="emitStaticId.html">emitStaticId</a></li><li><a href="off.html">off</a></li><li><a href="on.html">on</a></li><li><a href="once.html">once</a></li><li><a href="willEmit.html">willEmit</a></li><li><a href="willEmitId.html">willEmitId</a></li></ul><h3>Global</h3><ul><li><a href="global.html#$main">$main</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Oct 30 2017 16:01:17 GMT+0000 (GMT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>