Skip to content

Commit

Permalink
perf: refactor custom component registration config
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Oct 3, 2024
1 parent 54214b1 commit 910cac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NOTICE

.github/
.gitignore
.eslintrc
eslint.config.mjs
.stylelintrc

coverage/
Expand Down
13 changes: 2 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import { AuroDatePicker } from "./src/auro-datepicker.js";
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';

/**
* Register Custom Element.
* @param {String} name - Name to use for custom element.
* @returns {void}
*/
export function registerComponent(name) {
// alias definition
if (!customElements.get(name)) {
customElements.define(name, class extends AuroDatePicker {});
}
}
RuntimeUtils.default.prototype.registerComponent('custom-datepicker', AuroDatePicker);

0 comments on commit 910cac2

Please sign in to comment.