Skip to content

shine977/wechat-regenerator-runtime

Repository files navigation

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

About

let Wechat Mini Program support for async/await

Resources

License

Stars

Watchers

Forks

Packages

No packages published