diff --git a/src/index.ts b/src/index.ts index 4634160..e0825ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,7 @@ function initShareonChild(child: HTMLElement, preset: PublishPreset) { } } -window.onload = () => { +const initializeShareon = () : void => { const shareonContainers = document.getElementsByClassName('shareon'); for (let i = 0; i < shareonContainers.length; i += 1) { @@ -70,3 +70,7 @@ window.onload = () => { } } }; + +window.onload = () => { initializeShareon(); }; + +export default initializeShareon;