Skip to content

xingyibiao/wx-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

使用方法

// 引入方法
import { promisifys, toPromisify } from './promisy.js'

// 以request举例,其他同理
promisifys.request({url: 'xxx'})
  .then((res) => {
    // TODO somethings
  }).catch((err) => {
    // TODO somethings
  })


// 亦可以使用工厂方法构造自己的promise

const func = toPromisify(wx.xxx)

func(option)
  .then((res) => {
    // TODO somethings
  }).catch((err) => {
    // TODO somethings
  })

About

封装微信小程序原生api为返回promise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published