Skip to content

Files

Latest commit

e7644ea · Sep 15, 2021

History

History
35 lines (24 loc) · 1 KB

README.md

File metadata and controls

35 lines (24 loc) · 1 KB

vue-composition-toolset Travis (.com) Codecov

Minimalist design

Provide users with the simplest and most direct development experience

Install

Thanks for vue-demi, it works for both Vue 2 & 3.

npm i vue-composition-toolset

Usage

import { useTimerFn } from 'vue-composition-toolset'

export default {
  setup() {
    const doSomething = () => {
      /* your function */
    }
    const { trigger } = useTimerFn(doSomething, 30 * 1000) // The function will be executed every 30 seconds

    trigger.value = false // Disable the timer that executes the function
    trigger.value = true // Enable the timer that executes the function
  }
}

License

MIT License © 2021-PRESENT leafstark