@dx-libs/timeout

0.1.1 • Public • Published

@dx-libs/timeout v0.1.0

Libreria de Timeout en @dx-libs/timeout

Scripts

npm run eslint
npm run test-watch
npm run test
npm run sonar

Instalación

Como libreria

npm install --save @dx-libs/timeout

Modo de uso

const timeout = require("@dx-libs/timeout");

timeout(() => { console.log('TIMEOUT !'); return 42; }, 1000)
    .then((value) => {
        console.log('CALLBACK!', value);
    });

const t = timeout(() => { console.log('NEVER !!'); }, 2000)
    .then((value) => {
        console.log('CALLBACK CANCELED!', value);
    });

t.cancel();

Package Sidebar

Install

npm i @dx-libs/timeout

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

5.13 kB

Total Files

8

Last publish

Collaborators

  • dx-team