# vue-timing-events

> Cleanup timing events on component destroy

Latest version **0.1.1** (published 2021-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-timing-events
pnpm add vue-timing-events
yarn add vue-timing-events
bun add vue-timing-events
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-01-23 |
| First published | 2021-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Danny Pham |
| Maintainers | dannynpham |
| Keywords | vue, vuejs, plugin, timing, events |

## Links

- npm: https://www.npmjs.com/package/vue-timing-events
- npm.io page: https://npm.io/package/vue-timing-events

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2021-01-23
- 0.1.0 — 2021-01-22

## README

# Vue Timing Events ![License](https://badgen.net/github/license/dannynpham/vue-timing-events) ![Library size](https://badgen.net/bundlephobia/minzip/vue-timing-events) ![Dependencies](https://badgen.net/david/dep/dannynpham/vue-timing-events)

Automatically cleans up timers and event listeners on component beforeDestroy

## Install

```
$ npm install -D vue-timing-events

# For Yarn, use the command below.
yarn add vue-timing-events
```

# Usage

```js
import Vue from "vue";
import VueTimingEvents from 'vue-timing-events';

Vue.use(VueTimingEvents);
```

```js
// Somecomponent.vue
export default {
  created() {
    this.$setInterval(this.doInterval, 2000);
    this.$addEventListener("resize", this.onResize, { passive: true });
  },
  methods: {
    doInterval() {
      console.log("Are we there yet?");
    },
    onResize() {
      console.log("Hey stop triggering so much layout/reflow. :(");
    }
  }
}
```

## License

MIT © [Danny Pham](https://dannynpham.tech)

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