1.1.2 • Published 2 years ago

normal-async v1.1.2

Weekly downloads
5
License
ISC
Repository
github
Last release
2 years ago

async

对ES6 Promise 的原生实现,可用于不支持Promise的浏览器。

install

npm install -g normal-async

github

https://github.com/rookie-mr/async.git

基本用法

var async = new Async(function (resolve, reject) {
    setTimeout(function () {
        resolve(9527)
        // reject(9527)
        console.log('async', async)
    }, 2000)
    console.log('this:', this)
})
async.then(function (data) {
    setTimeout(function () {
        console.log('data 1:', data)
    })
}, function (err) {
    console.log('then err', err)
}).then(function (data) {
    console.log('data 2:', data)
}).catch(function (err) {
    console.log('catch err', err)
}).finally(function () {
    console.log('finally')
})
1.1.2

2 years ago

1.1.1

3 years ago

1.0.1

4 years ago