until.js 450 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.until = void 0;
  4. const tslib_1 = require("tslib");
  5. const tick_1 = require("./tick");
  6. const until = (check_1, ...args_1) => tslib_1.__awaiter(void 0, [check_1, ...args_1], void 0, function* (check, pollInterval = 1) {
  7. do {
  8. if (yield check())
  9. return;
  10. yield (0, tick_1.tick)(pollInterval);
  11. } while (true);
  12. });
  13. exports.until = until;