1 | /** @license MIT License (c) copyright 2011-2013 original author or authors */
|
2 |
|
3 | /**
|
4 | * timeout.js
|
5 | *
|
6 | * Helper that returns a promise that rejects after a specified timeout,
|
7 | * if not explicitly resolved or rejected before that.
|
8 | *
|
9 | * @author Brian Cavalier
|
10 | * @author John Hann
|
11 | */
|
12 |
|
13 | (function(define) {
|
14 | define(function(require) {
|
15 |
|
16 | var when = require('./when');
|
17 |
|
18 | /**
|
19 | * @deprecated Use when(trigger).timeout(ms)
|
20 | */
|
21 | return function timeout(msec, trigger) {
|
22 | return when(trigger).timeout(msec);
|
23 | };
|
24 | });
|
25 | })(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); });
|
26 |
|
27 |
|