ES6 异步操作和Async函数(14)
时间:2021-06-24 13:06 来源:汽车之家 作者:阿虎 点击:次
Generator Promise then onFulfilled next Thunk Promise Promise rejected co yield // co( function * () { var res = yield [ Promise .resolve( 1 )。
done: true } }); PromisePromiseresolvePromise nextPromiseawait async function f () { const asyncIterable = createAsyncIterable([ a , x); f Thunk Thunk function f ( m ) { return m * 2 ;}f(x + 5 ); // var thunk = function () { return x + 5 ;}; function f ( thunk ) { return thunk() * 2 ;} (责任编辑:admin) |