@promises/timeout
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@promises/timeout

Source Code Version MIT License Bundle Size

Timeout is package from Promises library

Use

Module

$ npm install --save @promises/timeout
import {
 default as timeout
} from '@promises/timeout';

Browser

<script src="https://unpkg.com/@promises/timeout/bundle.umd.min.js"></script>
let {
 timeout
} = P;

Examples

 let promise: Promise<string> = timeout<string>((resolve, reject)=>{
     resolve('foo')
 }, 3000);

 promise.then((result: string)=>{
     console.log(result); // result => 'foo'
 });

Wrapper

Module

$ npm install --save @promises/timeout
import Promises from '@promises/core';
import '@promises/timeout/add';

Or

import Promises from '@promises/timeout/add';

Browser

<script src="https://unpkg.com/@promises/core/bundle.umd.min.js"></script>
<script src="https://unpkg.com/@promises/timeout/add/bundle.umd.min.js"></script>
let {
 Promises
} = P;

Examples

 let promises: Promises<string> = Promises.timeout<string>((resolve, reject)=>{
     resolve('foo')
 }, 3000);

 promises.then((result: string)=>{
     console.log(result); // result => 'foo'
 });

Compatibility

These modules are written in typescript and available in ES5 and ES6 standard, the requirements are a global Promise (native or polyfill).

License

Copyright © 2017 Yisrael Eliav, Licensed under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.0
    1
    • latest

Version History

Package Sidebar

Install

npm i @promises/timeout

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

26.9 kB

Total Files

27

Last publish

Collaborators

  • yisraelx