# animation-resolve

> [![NPM publish](https://github.com/kevinkace/animation-resolve/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/kevinkace/animation-resolve/actions/workflows/npm-publish.yml) [![npm version](https://badge.fury.io/js/animation-resolve.svg)]

Latest version **3.2.5** (published 2023-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install animation-resolve
pnpm add animation-resolve
yarn add animation-resolve
bun add animation-resolve
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.2.5 |
| Published | 2023-02-05 |
| First published | 2018-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin A. Cameron |
| Maintainers | kevinkace |

## Links

- npm: https://www.npmjs.com/package/animation-resolve
- Repository: https://github.com/kevinkace/animation-resolve
- Homepage: https://github.com/kevinkace/animation-resolve#readme
- Issues: https://github.com/kevinkace/animation-resolve/issues
- npm.io page: https://npm.io/package/animation-resolve

## Recent versions

- 3.2.5 (latest) — 2023-02-05
- 3.2.4 — 2023-02-05
- 3.2.3 — 2023-01-28
- 3.2.2 — 2020-08-26
- 3.2.1 — 2019-11-06
- 3.2.0 — 2018-12-02
- 3.0.1 — 2018-12-02
- 2.0.3 — 2018-12-02
- 2.0.2 — 2018-12-02

## README

# Animation Resolve

[![NPM publish](https://github.com/kevinkace/animation-resolve/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/kevinkace/animation-resolve/actions/workflows/npm-publish.yml)
[![npm version](https://badge.fury.io/js/animation-resolve.svg)](https://badge.fury.io/js/animation-resolve)

Small module I often use with [Mithril.js](https://github.com/mitrhiljs/mithril.js) and `onbeforeremove()` to [animate a component before removing it from the DOM](https://github.com/MithrilJS/mithril.js/blob/next/docs/animation.md#animation-on-element-removal).

This module (ESM and CJS) supplies a function that returns a Promise which resolves when a CSS animation completes after updating a DOM nodes CSS class.

## With Mithril

```css
.animateOut {
    animation: forwards 500ms animateOut;
}

@keyframes animateOut {
    100% {
        opacity: 0;
    }
}
```

```js
import animationResolve from "animation-resolve";

export default {
    onbeforeremove(vnode) => animationResolve(vnode.dom, "animateOut"),

    view() {
        return m("div", "animates out");
    }
}
```

---
_Source: https://npm.io/package/animation-resolve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
