0.1.1 • Published 5 years ago

@dx-libs/timeout v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@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();