aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/library/modules/core.delay.js
blob: ea031be4a8fb7c330a44298fbbbcf4a702f4d0af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
var global  = require('./_global')
  , core    = require('./_core')
  , $export = require('./_export')
  , partial = require('./_partial');
// https://esdiscuss.org/topic/promise-returning-delay-function
$export($export.G + $export.F, {
  delay: function delay(time){
    return new (core.Promise || global.Promise)(function(resolve){
      setTimeout(partial.call(resolve, true), time);
    });
  }
});