@zyrab/domo 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/Router.js +6 -3
package/package.json
CHANGED
package/src/core/Router.js
CHANGED
|
@@ -3,8 +3,7 @@ let _listeners = [];
|
|
|
3
3
|
const _scrollPositions = {};
|
|
4
4
|
let _previousUrl = "";
|
|
5
5
|
|
|
6
|
-
let _root
|
|
7
|
-
_root.id = "main";
|
|
6
|
+
let _root;
|
|
8
7
|
|
|
9
8
|
function init() {
|
|
10
9
|
["DOMContentLoaded", "popstate"].forEach((event) =>
|
|
@@ -130,7 +129,11 @@ const Router = {
|
|
|
130
129
|
* Mount point of the router, where components will be rendered.
|
|
131
130
|
* @returns {HTMLElement} The root DOM element used by the router.
|
|
132
131
|
*/
|
|
133
|
-
mount: () =>
|
|
132
|
+
mount: () => {
|
|
133
|
+
_root = document.createElement("main");
|
|
134
|
+
_root.id = "main";
|
|
135
|
+
return _root;
|
|
136
|
+
},
|
|
134
137
|
|
|
135
138
|
/**
|
|
136
139
|
* Initializes the router by setting up event listeners and loading the initial route.
|