1107798da6
Generated with a codemode: https://github.com/ember-cli/ember-modules-codemod
11 lines
284 B
JavaScript
11 lines
284 B
JavaScript
import RSVP from 'rsvp';
|
|
|
|
// An always failing promise used to race against other promises
|
|
export default function timeout(duration) {
|
|
return new RSVP.Promise((resolve, reject) => {
|
|
setTimeout(() => {
|
|
reject(`Timeout of ${duration}ms exceeded`);
|
|
}, duration);
|
|
});
|
|
}
|