Skip to content

makesites/tick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tick

Clocking methods using requestAnimationFrame. It is named tick (and not clock) because it is not meant to be an independent unit, rather a utility that's attached to other processes that just executes on intervals. In that regards, it is merely a more elegant setInterval.

Usage

First initialize the lib:

var tick = new Tick();

Then add as many metohds in sequence using the ````add``` method:

tick.add(function(){
	// ...
}, 1000);

Optionally we can set the interval as a second parameter.

Later we may need to remove the method, we use remove:

tick.remove(function(){
	// ...
});

Credits

Initiated by Makis Tracend ( @tracend )

Distributed through Makesites.org

License

Released under the MIT license

About

Clock methods using requestAnimationFrame

Resources

Stars

Watchers

Forks

Packages

No packages published