@netsells/vue-set-timeout

Use setTimeout and setInterval safely in Vue
4,000 1
Install
npm install @netsells/vue-set-timeout
Latest Version:0.1.5
Vue:2
License:ISC
Last Updated:Apr 13, 2022
Links: GitHub  ·  npm
Maintainer: rebeccaanderton

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

Related Packages

@netsells/storybook-nuxt-auth

This package provides an easy and convenient way to mock your nuxt auth state in...

3,390 1
@netsells/nuxt-healthcheck

Nuxt healthcheck module

1,439
@netsells/nuxt-hotjar

Nuxt hotjar plugin

34,076 19
@netsells/storybook-router

This package provides an easy and convenient way to provide routes to your Vue-b...

4,263 0

Version History

Version Released Vue License
0.1.5 ^2.6.10 ISC
0.1.4 ^2.6.10 ISC
0.1.3 ^2.6.10 ISC
0.1.2 ^2.6.10 ISC
0.1.1 ^2.6.10 ISC