@www778878net/promise78
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

简介 introduction

promise封装

  1. 不要try catch
  2. no try catch
  3. 返回[err,back]
  4. reback [err,back]
  5. if(err)告警然后返回即可;然后使用back值
  6. 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

Package Sidebar

Install

npm i @www778878net/promise78

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

15 kB

Total Files

6

Last publish

Collaborators

  • www778878net