From 73b54c385a70fa9d5068405cb3ceae5baeef7176 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 10 Feb 2022 20:32:40 +0100 Subject: [PATCH] Write new index.js for the package --- src/{autoinit.js => index.js} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename src/{autoinit.js => index.js} (56%) diff --git a/src/autoinit.js b/src/index.js similarity index 56% rename from src/autoinit.js rename to src/index.js index b8ac85a..43fcaef 100644 --- a/src/autoinit.js +++ b/src/index.js @@ -1,8 +1,10 @@ import initializeShareon from "./shareon"; import "./style.css"; -window.onload = () => { +// TODO: update README +const s = document.currentScript; +if (s && s.hasAttribute("init")) { initializeShareon(); -}; +} export default initializeShareon;