Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeSimoes committed Oct 7, 2024
1 parent 17b8d9c commit d7db927
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ document.body.append(...renderVirtualDom(window.raqnVirtualDom));
// EG callback to loadModules
await Promise.all(window.inicialization).then(() => {
// some after main modules loaded
console.log('All modules loaded');

Check warning on line 12 in scripts/index.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
});
5 changes: 3 additions & 2 deletions scripts/render/dom-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export const toWebComponent = (node) => {
};

// load modules in order of priority
export const loadModules = (nodes, modules = loadedComponents) => {
// load all modules and return a promise for queuing

export const loadModules = (nodes, extra = {}) => {
const modules = { ...loadedComponents, ...extra };
window.inicialization = Object.keys(modules)
.sort((a, b) => modules[a].priority - modules[b].priority)
.map((component) => {
Expand Down

0 comments on commit d7db927

Please sign in to comment.