From 8c7d16500a214682a3593718fdacc21bd25650c0 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Sun, 22 Dec 2024 23:16:30 +0700 Subject: [PATCH] added lazy loading --- README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2904f46..7487b07 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,23 @@ Module for creating "hot lines" ``` ```js -// Initializing an instance of hotline manually -const instance = new hotline( - 'articles', - document.getElementById('wrap_articles') -); - -// Initializing settings of the hotline instance -instance.move = false; -instance.wheel = true; -instance.delta = 15; +import("/js/modules/hotline.mjs").then((hotline) => { + // Imported the hotline.mjs module -// Starting the hotline instance -instance.start(); + // Initializing an instance of hotline manually + const instance = new hotline.default( + 'articles', + document.getElementById('wrap_articles') + ); + + // Initializing settings of the hotline instance + instance.move = false; + instance.wheel = true; + instance.delta = 15; + + // Starting the hotline instance + instance.start(); +}); ``` ## Preview