1.0.5 • Published 2 years ago

@shop25/notifications-iframe v1.0.5

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Install

npm i @shop25/notifications-iframe

Usage

import { NotificationClient } from '@shop25/notifications-iframe'

const mainWidgetTarget = document.querySelector("body") as HTMLElement;
const popupsMoutPoint = document.querySelector("#app") as HTMLElement;

const client = new NotificationClient({
    host: "https://widget-notifications.s25.work",
    project: "vodnik",
});

const mainWidget = client.createMainWidget();
const popupWidget = client.createPopupWidget();

async function init() {
    await mainWidget.mount(mainWidgetTarget);
    await popupWidget.mount(popupsMoutPoint);

    popupWidget.onChangeTotalCount((totalCount: number) => {
        console.log({ totalCount });
    });

    # if need
    mainWidget.destroy();
    popupWidget.destroy();
}

init();
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.0.1

2 years ago