3.2.1 • Published 5 months ago

small-promise v3.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Promise

Usage

const Promise = require('small-promise');
let p1 = new Promise(function(resolve,reject){
  setTimeout(()=>{
    reject({
      success:true,
      data:1
    })
  },100)
})

p1.then((res)=>{
  return 1
}).then((res)=>{
  console.log(res)
})

problem

调用then方法的时候如果不是pedding状态,原生的Promise会放进微任务批量处理,这里的Promise是立即执行

3.2.1

5 months ago

3.2.0

5 months ago

3.1.0

5 months ago

3.0.1

5 months ago

3.0.0

5 months ago

2.0.3

5 months ago

2.0.2

5 months ago

2.0.1

5 months ago

1.1.1

2 years ago

1.1.2

2 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.12.0

3 years ago

0.10.1

3 years ago