@www778878net/promise78
v0.0.2
Published
no try catch;let [err,data]= await Promise78func()
Downloads
1
Maintainers
Readme
简介 introduction
promise封装
- 不要try catch
- no try catch
- 返回[err,back]
- reback [err,back]
- if(err)告警然后返回即可;然后使用back值
- if(err)warn and return ;get back
适用端 apply
use for js ts
project
|端|支持| |---|---| |Web|√| |微信小程序|√| |iOS|√| |Android|√|
依赖 rely on
nothing
属性 props
nothing
方法 method
nothing
DEMO
...
//const clone78 = require('../dist/index').default;
import Promise78 from "@www778878net/promise78"
function test() {
return new Promise78((resolve, reject) => {
setTimeout(() => {
reject("testerr")
}, 1000)
})
}
let [err, back] = await test();
if(err){
console.log(err)
return
}
...
OTHER
https://github.com/www778878net/promise78.git you can see test/test.js