Use non-default export
parent
51ec64b236
commit
d5141a6383
|
@ -109,8 +109,8 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import initializeShareon from "./src/shareon.js";
|
import { init } from "./src/shareon.js";
|
||||||
initializeShareon();
|
init();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import initializeShareon from "./shareon";
|
import { init } from "./shareon";
|
||||||
|
|
||||||
// TODO: update README
|
// TODO: update README
|
||||||
const s = document.currentScript;
|
const s = document.currentScript;
|
||||||
if (s && s.hasAttribute("init")) {
|
if (s && s.hasAttribute("init")) {
|
||||||
initializeShareon();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
export { default } from "./shareon";
|
export { init } from "./shareon";
|
||||||
|
|
|
@ -34,7 +34,7 @@ const openUrl = (buttonUrl) => () => {
|
||||||
window.open(buttonUrl, "_blank", "noopener,noreferrer");
|
window.open(buttonUrl, "_blank", "noopener,noreferrer");
|
||||||
};
|
};
|
||||||
|
|
||||||
const initializeShareon = () => {
|
const init = () => {
|
||||||
const shareonContainers = document.querySelectorAll(".shareon");
|
const shareonContainers = document.querySelectorAll(".shareon");
|
||||||
|
|
||||||
// iterate over <div class="shareon">
|
// iterate over <div class="shareon">
|
||||||
|
@ -90,4 +90,4 @@ const initializeShareon = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default initializeShareon;
|
export { init };
|
||||||
|
|
Loading…
Reference in New Issue