首页 开发技术 其它     /    comlink:Comlink使WebWorkers变得愉快-源码

comlink:Comlink使WebWorkers变得愉快-源码

上传者: weixin_42116921 | 上传时间:2025/4/15 10:09:12 | 文件大小:48KB | 文件类型:ZIP
comlink:Comlink使WebWorkers变得愉快-源码
康联Comlink使变得愉快。
Comlink是一个很小的库(1.1kB),它消除了思考postMessage的心理障碍,并掩盖了您与工人一起工作的事实。
在更抽象的层次上,它是针对postMessage和的RPC实现。
$npminstall--savecomlink浏览器支持和捆绑包大小不支持浏览器可以使用。
大小:〜2.5k,〜1.2kgzip'd,〜1.1kbrotli'd介绍在移动电话上,尤其是在低端移动电话上,重要的是保持主线程尽可能空闲,以便它可以快速响应用户交互并提供无垃圾的体验。
UI线程应该仅用于UI工作。
WebWorkers是一个WebAPI,允许您在单独的线程中运行代码。
为了与另一个线程通信,WebWorkers提供了postMessageAPI。
您可以使用myWorker.postMessage(someObject)将 本软件ID:15492179

文件下载

资源详情

[{"title":"(52个子文件48KB)comlink:Comlink使WebWorkers变得愉快-源码","children":[{"title":"comlink-master","children":[{"title":".gitignore <span style='color:#111;'>64B</span>","children":null,"spread":false},{"title":"Dockerfile <span style='color:#111;'>575B</span>","children":null,"spread":false},{"title":"package.json <span style='color:#111;'>1.67KB</span>","children":null,"spread":false},{"title":"src","children":[{"title":"protocol.ts <span style='color:#111;'>2.46KB</span>","children":null,"spread":false},{"title":"comlink.ts <span style='color:#111;'>16.88KB</span>","children":null,"spread":false},{"title":"node-adapter.ts <span style='color:#111;'>1.61KB</span>","children":null,"spread":false}],"spread":true},{"title":"CODEOWNERS <span style='color:#111;'>7B</span>","children":null,"spread":false},{"title":"karma.conf.js <span style='color:#111;'>1.98KB</span>","children":null,"spread":false},{"title":"CONTRIBUTORS <span style='color:#111;'>465B</span>","children":null,"spread":false},{"title":".travis.yml <span style='color:#111;'>122B</span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'>11.08KB</span>","children":null,"spread":false},{"title":"CHANGELOG.md <span style='color:#111;'>364B</span>","children":null,"spread":false},{"title":"tsconfig.json <span style='color:#111;'>4.54KB</span>","children":null,"spread":false},{"title":"rollup.config.js <span style='color:#111;'>1.61KB</span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'>11.20KB</span>","children":null,"spread":false},{"title":"tests","children":[{"title":"same_window.comlink.test.js <span style='color:#111;'>17.07KB</span>","children":null,"spread":false},{"title":"tsconfig.json <span style='color:#111;'>111B</span>","children":null,"spread":false},{"title":"worker.comlink.test.js <span style='color:#111;'>1.27KB</span>","children":null,"spread":false},{"title":"type-checks.ts <span style='color:#111;'>10.92KB</span>","children":null,"spread":false},{"title":"iframe.comlink.test.js <span style='color:#111;'>1.23KB</span>","children":null,"spread":false},{"title":"two-way-iframe.comlink.test.js <span style='color:#111;'>1.41KB</span>","children":null,"spread":false},{"title":"fixtures","children":[{"title":"iframe.html <span style='color:#111;'>163B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>687B</span>","children":null,"spread":false},{"title":"two-way-iframe.html <span style='color:#111;'>306B</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"CONTRIBUTING <span style='color:#111;'>1.42KB</span>","children":null,"spread":false},{"title":"structured-clone-table.md <span style='color:#111;'>3.40KB</span>","children":null,"spread":false},{"title":"docs","children":[{"title":"examples","children":[{"title":"07-sharedworker-example","children":[{"title":"README.md <span style='color:#111;'>80B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>641B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>1.06KB</span>","children":null,"spread":false}],"spread":false},{"title":"99-nonworker-examples","children":[{"title":"iframes","children":[{"title":"iframe.html <span style='color:#111;'>304B</span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'>115B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>495B</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"01-simple-example","children":[{"title":"README.md <span style='color:#111;'>72B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>499B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>818B</span>","children":null,"spread":false}],"spread":false},{"title":"02-callback-example","children":[{"title":"README.md <span style='color:#111;'>42B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>420B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>839B</span>","children":null,"spread":false}],"spread":false},{"title":"03-classes-example","children":[{"title":"README.md <span style='color:#111;'>50B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>666B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>960B</span>","children":null,"spread":false}],"spread":false},{"title":"04-eventlistener-example","children":[{"title":"README.md <span style='color:#111;'>108B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>496B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>951B</span>","children":null,"spread":false},{"title":"event.transferhandler.js <span style='color:#111;'>420B</span>","children":null,"spread":false}],"spread":false},{"title":"05-serviceworker-example","children":[{"title":"README.md <span style='color:#111;'>80B</span>","children":null,"spread":false},{"title":"index.html <span style='color:#111;'>761B</span>","children":null,"spread":false},{"title":"worker.js <span style='color:#111;'>1.02KB</span>","children":null,"spread":false}],"spread":false},{"title":"06-node-example","children":[{"title":"main.mjs <span style='color:#111;'>328B</span>","children":null,"spread":false},{"title":"worker.mjs <span style='color:#111;'>263B</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"index.html <span style='color:#111;'>107B</span>","children":null,"spread":false}],"spread":false},{"title":"renovate.json <span style='color:#111;'>56B</span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明