timeout.js
Readme
Simple promise-based timeout
Installation
npm install --save timeout.js
Usage
const timeout = ; // call then callback after 200ms; // call catch after .break() calledconst exm = ; exm ; // stop timeout and reject promiseexm; // resolve data after time out ;
Async/Await
{ return } { await console const data = await console}
Timeout chaining
const timeout = ; // simple; // create timeout with predefined timeconst out = timeout; ; // with dataconst waitFor = timeout; ; // make timeout with predefined dataconst waitData = timeout; ; // override ;
License
Copyright © 2016 Sergey Sova <i.am@lestad.net>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file or http://www.wtfpl.net/
for more details.