open-nomad/ui/app/utils/wait.js
2022-01-20 09:46:45 -05:00

11 lines
257 B
JavaScript

import RSVP from 'rsvp';
// An always passing promise used to throttle other promises
export default function wait(duration) {
return new RSVP.Promise((resolve) => {
setTimeout(() => {
resolve(`Waited ${duration}ms`);
}, duration);
});
}