learning-webworkers:学习WebWorkers(和comlink)

时间:2021-05-01 19:12:19
【文件属性】:
文件名称:learning-webworkers:学习WebWorkers(和comlink)
文件大小:276KB
文件格式:ZIP
更新时间:2021-05-01 19:12:19
HTML 学习WebWorkers(和comlink) 这只是我正在学习的一件事。 注意:服务端可以修改网络请求,但是服务端可以运行昂贵的脚本而无需冻结UI: : WebWorkers甚至在IE 10中也可用。 您可以使用WebWorkers释放主线程和UI,并帮助应用程序在低端设备上更快地工作。 而且,您可以通过使用而不是尝试管理WebWorker消息传递来使WebWorker在主线程中更易于使用(因为WebWorkers无法直接访问DOM之类的东西)。 使用Web Worker的React的实时示例: ://codesandbox.io/s/n06fu?file src/ 从头开始 使用 : npm init yarn add comlink yarn add parcel --dev 或使用npm : npm init npm install comlink npm
【文件预览】:
learning-webworkers-main
----.gitignore(40B)
----README.md(2KB)
----comlink-demo()
--------tsconfig.json(476B)
--------public()
--------package.json(631B)
--------src()
--------yarn.lock(457KB)
----public()
--------worker.js(171B)
--------index.html(667B)
----package.json(657B)
----yarn.lock(264KB)

网友评论