1.0.1 • Published 6 years ago

reverse-timer-func v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Some ifo

This function creates a little object by Closure. If you call it by function() you will start timer iteration, but you also have some functions of your object that can help you to control your timer: setStep(int) - set step of iteration (seconds) setRange(int) - set range of iteration (seconds) setReverse(bool) - set reverse iteration if you whant pause(bool) - make pause if you whant


Function requiers any value that will be valid for Date(). Optional you can pass: step :int, range :int, reverse :bool


try it

const timer = require('reverse-timer-func');

const test = timer(new Date);

setInterval(function () {
  console.log(test())
}, 1000)