]> git.r.bdr.sh - rbdr/heart/blame_incremental - js/app.js
Update changelog to reflect release
[rbdr/heart] / js / app.js
... / ...
CommitLineData
1'use strict';
2
3// Sets up the application
4
5((window) => {
6
7 const internals = {};
8
9 internals.onLoad = () => {
10
11 const mainElement = window.document.getElementById('heart-app-entry-point');
12 const heartRenderer = new HeartRenderer();
13
14 heartRenderer.render(mainElement);
15 heartRenderer.activate();
16
17 window.addEventListener('resize', heartRenderer.resize.bind(heartRenderer));
18
19 /**
20 * Exported global object. This will contain the instance of the heart
21 * renderer being used. It is set up on load.
22 *
23 * @name App
24 * @type Object
25 * @property {HeartRenderer} heartRenderer The instance of the heart renderer being used.
26 */
27 window.App = {
28 heartRenderer
29 };
30 };
31
32 window.addEventListener('load', internals.onLoad);
33})(window);