UNPKG

@mint-ui/map

Version:

- React map library - Control various map with one interface - Google, Naver, Kakao map supported now - Typescript supported - Canvas marker supported

38 lines (30 loc) 888 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var tslib = require('tslib'); function waiting(evaluation, timeoutSeconds) { return tslib.__awaiter(this, void 0, void 0, function () { var max; return tslib.__generator(this, function (_a) { max = (timeoutSeconds || 5) * 1000; return [2 /*return*/ , new Promise(function (resolve) { var start = new Date().getTime(); var inter = setInterval(function () { //타임아웃 체크 var time = new Date().getTime(); if (time - start > max) { clearInterval(inter); resolve(false); return; } //평가식 체크 if (evaluation()) { clearInterval(inter); resolve(true); } }, 100); })]; }); }); } exports.waiting = waiting;