johnnydepp icon indicating copy to clipboard operation
johnnydepp copied to clipboard

feature request: import() to return a promise

Open cekvenich opened this issue 4 years ago • 0 comments

eg:

function imp(moduleJs) {
  depp.define({moduleJs:moduleJs})
  return new Promise(function (resolve, reject) {
    depp.require(moduleJs, function () {
      resolve('OK')
    })
  })//pro
}//()

Something like this would return a promise after a script is loaded (without having to name the script). Of course it may need a promise polyfill.

cekvenich avatar Sep 12 '19 15:09 cekvenich