github.com/hernad/nomad@v1.6.112/ui/app/utils/wait.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import RSVP from 'rsvp';
     7  
     8  // An always passing promise used to throttle other promises
     9  export default function wait(duration) {
    10    return new RSVP.Promise((resolve) => {
    11      setTimeout(() => {
    12        resolve(`Waited ${duration}ms`);
    13      }, duration);
    14    });
    15  }