UNPKG

blinx

Version:

The Scalable JavaScript Application Framework

138 lines (110 loc) 4.45 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: src/interfaces/store.js</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">Source: src/interfaces/store.js</h1> <section> <article> <pre class="prettyprint source linenums"><code> let moduleS = Object.assign([], { /** * inserts the instance into the module store * @param instance of {@link Module} */ insertInstance: function (instance) { this.push(instance); }, /** * deletes the instance of the module. Removes the entry from the module store * instance of {@link Module} * @param id */ deleteInstance: function (id) { for (var i= this.length-1; i>=0; i--) { if (this[i].meta.id === id) { this.splice(i, 1); break; } } }, /** * Finds all the instances of the module from the module store * @param name of the module to be searched * @returns {Array} of all the instances of the module */ findInstance: function (id, name) { if(id){ return this.filter(function (module) { if(module.meta.id === id){ return module; } }); } else if(name){ return this.filter(function (module) { if(module.name === name){ return module; } }); } else { return []; } } }); /** * {@todo reserved for future use} * @type {boolean} */ let isBrowser = typeof window !== "undefined"; /** * {@todo reserved for future use} * @type {boolean} */ let isServer = !isBrowser; /** * To be used by {@link pubsub} * {Object} List of all the subscriptions of all the events. Present in the format {"eventName": {subscription object}} */ let subscriptions = {}; /** * * @type {{store: Array}} */ let eventQ = {store: []}; let middleWareFns = []; /** * @module */ export { isBrowser, subscriptions, moduleS, isServer, eventQ, middleWareFns }; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Module.html">Module</a></li><li><a href="module-src_interfaces_store.html">src/interfaces/store</a></li></ul><h3>Classes</h3><ul><li><a href="module-Module-Module.html">Module</a></li><li><a href="PubSub.html">PubSub</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_callRender">_callRender</a></li><li><a href="global.html#_callResolveRenderOn">_callResolveRenderOn</a></li><li><a href="global.html#_emitLifeCycleEvent">_emitLifeCycleEvent</a></li><li><a href="global.html#_listenForInitOn">_listenForInitOn</a></li><li><a href="global.html#_lockEvents">_lockEvents</a></li><li><a href="global.html#_onBreath">_onBreath</a></li><li><a href="global.html#_registerModule">_registerModule</a></li><li><a href="global.html#_registerSubscription">_registerSubscription</a></li><li><a href="global.html#_startExec">_startExec</a></li><li><a href="global.html#addMethodsOnInstance">addMethodsOnInstance</a></li><li><a href="global.html#createInstance">createInstance</a></li><li><a href="global.html#deleteInstance">deleteInstance</a></li><li><a href="global.html#destroyModuleInstance">destroyModuleInstance</a></li><li><a href="global.html#eventQ">eventQ</a></li><li><a href="global.html#findInstance">findInstance</a></li><li><a href="global.html#insertInstance">insertInstance</a></li><li><a href="global.html#isBrowser">isBrowser</a></li><li><a href="global.html#isServer">isServer</a></li><li><a href="global.html#iterateToAddMethodsOnInstance">iterateToAddMethodsOnInstance</a></li><li><a href="global.html#lifeCycleFlags">lifeCycleFlags</a></li><li><a href="global.html#Router">Router</a></li><li><a href="global.html#subscriptions">subscriptions</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Tue Jul 05 2016 12:45:01 GMT+0530 (IST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>