1.0.8 • Published 10 months ago

fortimer v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

fortimer

Manage your JavaScript timer.

Install

  npm i fortimer //or yarn add fortimer

Usage

  import Timer from 'fortimer'
  let timer = new Timer()
  timer.add({
    name: 'test',
    repeat: true,
    func: () => {
      console.log(new Date())
    }
  })
  • add(obj = {})

    • {Object} config
      • {String} name: timer name
      • {Boolean} repeat: default false,true for setInterval(),false for setTimeout()
      • {Number} duration: timer duraion,default 1000ms
      timer.add({
        name: 'test',
        repeat: true,
        duration: 10e3,
        func: ()=>{
          console.log(new Date())
        }
      });
      // return timer
  • getAll()

      timer.getAll();
  • remove(name)

    • {String} name: timer name
      timer.remove('test');
  • removeAll()

      timer.removeAll();
1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago