Gazebo_simulation-Frontend/node_modules/@redux-saga/delay-p/dist/redux-saga-delay-p.cjs.js
2020-12-21 10:29:31 -05:00

25 lines
441 B
JavaScript

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var symbols = require('@redux-saga/symbols');
function delayP(ms, val) {
if (val === void 0) {
val = true;
}
var timeoutId;
var promise = new Promise(function (resolve) {
timeoutId = setTimeout(resolve, ms, val);
});
promise[symbols.CANCEL] = function () {
clearTimeout(timeoutId);
};
return promise;
}
exports.default = delayP;