Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 1.6 KB

README.md

File metadata and controls

43 lines (36 loc) · 1.6 KB

timeout-then

NPM version Build status Test coverage Dependency Status License Downloads

setTimeout as a promise.

const timeout = require('timeout-then');

timeout(100).then(function () {
  console.log('blah');
});

// clear timeout
let timer = timeout(100);
timer.then(function () {
  console.log('blah');
});
timer.clear();