async-dom

1.0.1 • Public • Published

async-dom

Asynchronously call a method after the DOM has changed. It is useful when animating with css classes.

Installation

npm install async-dom

Usage

import async, { cancel } from 'async-dom';
 
const element = document.querySelector('.my-node');
 
element.classList.add('will-show');
async(() => {
  element.classList.remove('will-show');
  element.classList.add('did-show');
});

/async-dom/

    Package Sidebar

    Install

    npm i async-dom

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • magnearun
    • olafursverrir
    • birkir
    • ueno-personal