0.1.5 • Published 4 years ago

@netsells/vue-set-timeout v0.1.5

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

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);
    },
}
0.1.5

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago