set-timeout
v0.1.0
Published
Delay the call of a function in a given context.
Downloads
11
Readme
set-timeout
Delay the call of a function in a given context.
Based on the excellent mout's timeout implementation, offered to you as a tiny module.
Install with npm
npm i set-timeout --save
Usage
Acts as a wrapper for setTimeout
. Calls the given fn
within the specified context
, after the given delay in ms
(milliseconds).
The return value can be used to clear the timeout using clearTimeout
.
var timeout = require('set-timeout');
var id = timeout(doStuff, 300, this);
clearTimeout(id);
Run tests
npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 12, 2014. To update, run npm i -g verb && verb
.