Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 730 Bytes

File metadata and controls

42 lines (29 loc) · 730 Bytes

wehcat-regenerator-runtime

Use async/await for wechat mini program projects

Thanks

original creator

Facebook-regenerator

installing

npm i wehcat-regenerator-runtime

usage in wechat mini program

const regeneratorRuntime = require('wehcat-regenerator-runtime');
const wf = require('wefetch');
// es6 write
async onload () {
    let res = await wf.get('/get')
    if (res) {
        // do something....
    }
    
    
}
// Es5 write
onload: async function () {
  let res = await wf.get('/get')
      console.log(res)
      
      // do something....
}

Use with the wefetch request library

wefetch