docs/Core.html
<!DOCTYPE html>
<html>
<head>
<title>Core.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page">
<a class="source" href="Core.html">
Core.js
</a>
<a class="source" href="EventTypes.html">
EventTypes.js
</a>
<a class="source" href="Kronicle.html">
Kronicle.js
</a>
<a class="source" href="Module.html">
Module.js
</a>
<a class="source" href="ArrayDataSource.html">
ArrayDataSource.js
</a>
<a class="source" href="Component.html">
Component.js
</a>
<a class="source" href="Controller.html">
Controller.js
</a>
<a class="source" href="DataSource.html">
DataSource.js
</a>
<a class="source" href="DataSources.html">
DataSources.js
</a>
<a class="source" href="DataSourcesEvents.html">
DataSourcesEvents.js
</a>
<a class="source" href="View.html">
View.js
</a>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>Core.js</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">require</span>(<span class="hljs-string">"babel/polyfill"</span>);
import {<span class="hljs-keyword">default</span> as PubSub} from <span class="hljs-string">'pubsub-js'</span>;
import {events} from <span class="hljs-string">'./EventTypes.js'</span>;</pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<h1 id="main-kronicle-core-class">Main Kronicle.Core class</h1>
<p>depends: pubsub-js, <a href="EventTypes.html">Kronicle.EventTypes</a>
This is the main Kronicle Core. This class is used to load all modules that are to be used in the Kronicle app.
Events are fired at various points to indiciate the status and can be used as hooks for library modules.
Constructor an array of Kronicle modules as an argument.</p>
</div>
<div class="content"><div class='highlight'><pre>export <span class="hljs-keyword">class</span> Core {
constructor(modules) {
PubSub.publish(events.Initialized);
<span class="hljs-keyword">this</span>.addedModules = {};
PubSub.publish(events.BeforeModulesLoad, modules);
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> mod of modules){
<span class="hljs-keyword">this</span>.addedModules[mod.name] = mod;
PubSub.publish(events.ModuleLoaded, mod);
}
PubSub.publish(events.AfterModulesLoad, modules);
PubSub.publish(events.Ready);
}
}</pre></div></div>
</li>
</ul>
</div>
</body>
</html>