@abtasty/widget-utils

Collection of useful functions for AB Tasty Widgets.

Stats

StarsIssuesVersionUpdatedCreatedSize
@abtasty/widget-utils
1.18.17a day ago4 years agoMinified + gzip package size for @abtasty/widget-utils in KB

Readme

Widgets Utils

Collection of useful functions for AB Tasty Widgets.

Installation

Inside your Widget folder, install the widget-utils library:

npm install @abtasty/widget-utils

Note: you can also use yarn instead of npm: yarn add @abtasty/widget-utils

Usage

With Webpack or Rollup.js:

import { waitForElement, isAffected } from '@abtasty/widget-utils'

const waitForBody = waitForElement('#section', section => {
    section.insertAdjacentHTML('beforeend', '<p>New paragraph at the end of that section.</p>');
});

setTimeout(() => {
    if (!isAffected()) {
        waitForBody.clear();
    }
}, 10000);

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.