异步函数的封装thunks.zip

时间:2022-08-05 12:41:37
【文件属性】:
文件名称:异步函数的封装thunks.zip
文件大小:78KB
文件格式:ZIP
更新时间:2022-08-05 12:41:37
开源项目 thunks 是一个虽小但却很有用的软件,它可用来封装所有异步函数。概述:thunk 是一个被封装了同步或异步任务的函数;thunk 有唯一一个参数 callback,是 CPS 函数;thunk 运行后返回新的 thunk 函数,形成链式调用;thunk 自身执行完毕后,结果进入 callback 运行;callback 的返回值如果是 thunk 函数,则等该 thunk 执行完毕将结果输入新 thunk 函数运行;如果是其它值,则当做正确结果进入新的 thunk 函数运行; 标签:thunks
【文件预览】:
thunks-master
----.travis.yml(220B)
----benchmark()
--------index.js(783B)
--------thunks.js(1KB)
--------promise.js(1KB)
--------bluebird.js(1KB)
--------then.js(1016B)
--------thunks-gen.js(1KB)
--------co.js(1KB)
--------async.js(1KB)
----index.js(12KB)
----docs()
--------eager-evaluation.md(6KB)
--------promise-or-thunk.md(8KB)
--------scope-and-error-catch.md(7KB)
--------api-zh.md(12KB)
----package.json(1KB)
----test()
--------thunk.js(39KB)
--------index.js(777B)
--------typings.test.ts(12KB)
--------generator.js(8KB)
--------async.js(781B)
----LICENSE(1KB)
----package-lock.json(97KB)
----index.mjs(11KB)
----tsconfig.json(203B)
----index.d.ts(4KB)
----examples()
--------observable.js(478B)
--------thunk-catch-error3.js(743B)
--------thunk-catch-error2.js(357B)
--------generator-array1.js(967B)
--------thunk-context.js(508B)
--------simple.js(517B)
--------async_await.mjs(683B)
--------parallel2.js(363B)
--------thunk-thenjs.js(346B)
--------generator-array2.js(867B)
--------generator-redis.js(385B)
--------function-error.js(693B)
--------thunkify.js(585B)
--------generator-return.js(963B)
--------thunk-co.js(718B)
--------generator-catch-error.js(522B)
--------thunk-throw-error.js(116B)
--------thunk-catch-error4.js(904B)
--------simple.ts(386B)
--------parallel1.js(431B)
--------series2.js(358B)
--------extreme.js(673B)
--------thunk-stop.js(566B)
--------series1.js(506B)
--------node-flow.js(502B)
--------thunk-catch-error1.js(221B)
--------generator-nested.js(514B)
--------generator-requests.js(616B)
----.gitignore(84B)
----README.md(20KB)

网友评论