@netsells/vue-set-timeout
Use setTimeout and setInterval safely in Vue
Last updated 4 months ago by sam.boylett .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @netsells/vue-set-timeout 
SYNC missed versions from official npm registry.

npm version Build Status codecov Mutation testing badge

Vue Set Timeout

A mixin to make it easy to safely use setTimeout, setInterval and clearTimeout in your Vue components without memory leaks

Usage

This mixin adds setTimeout, setInterval and clearInterval to the components class instance. They take the same arguments as the native JS functions, and return the same values.

import VueSetTimeout from '@netsells/vue-set-timeout';

export default {
    mixins: [VueSetTimeout],

    mounted() {
        this.setTimeout(() => {}, 10);
        const timer = this.setInterval(() => {}, 10);
        this.clearTimeout(timer);
    },
}

Current Tags

  • 0.1.5                                ...           latest (4 months ago)

6 Versions

  • 0.1.5                                ...           4 months ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (24)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |