promise-wsld
v1.0.0
Published
链式调用,解决回调地狱
Downloads
4
Readme
promise-ws
链式调用,解决回调地狱
install
npm install -g promise-wsld
#github https://gitee.com/HanShanShuiDi/promise-ws.git
#usage const MyPromise = require('./index.js') var p = new MyPromise((resolve,reject)=>{ setTimeout(()=>{ resolve(2) },1000) }) // then可以传成功失败函数,catch只能传失败函数 p.then(res=>{ console.log('resolve结果返回:', res) },err=>{ console.log('then错误结果分析:', err) }).catch(res=>{ console.log('catch错误结果分析:', res) })
