1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-23 07:09:42 +02:00
codex.docs/src/frontend/js/app.js
Umang G. Patel 13cc53e4ae
Feat/hawk integration (#210)
* update environment variable

* add: hawk nodejs and javascript catcher

* fontend hawk integration

* backend hawk integration

* update the env file and config files

* support for client, backend error tracking token

* client side error tracking refactor

* new version of hawk.nodejs catcher added
2022-07-26 09:56:20 +05:30

55 lines
1.2 KiB
JavaScript

// No inspection for unused var `css` because it's used for css bundle
// eslint-disable-next-line no-unused-vars
import '../styles/main.pcss';
/**
* Module Dispatcher
*
* @see {@link https://github.com/codex-team/moduleDispatcher}
* @author CodeX
*/
import ModuleDispatcher from 'module-dispatcher';
/**
* Import modules
*/
import Writing from './modules/writing';
import Page from './modules/page';
import Extensions from './modules/extensions';
import Sidebar from './modules/sidebar';
import HawkCatcher from '@hawk.so/javascript';
/**
* Main app class
*/
class Docs {
/**
* @class
*/
constructor() {
this.writing = new Writing();
this.page = new Page();
this.extensions = new Extensions();
this.sidebar = new Sidebar();
if (window.config.hawkClientToken) {
this.hawk = new HawkCatcher(window.config.hawkClientToken);
}
document.addEventListener('DOMContentLoaded', (event) => {
this.docReady();
});
console.log('CodeX Docs initialized');
}
/**
* Document is ready
*/
docReady() {
this.moduleDispatcher = new ModuleDispatcher({
Library: this,
});
}
}
export default new Docs();