【文件属性】:
文件名称:thaw.js:JavaScript中的合成异步处理
文件大小:78KB
文件格式:ZIP
更新时间:2021-05-02 08:55:29
TypeScript
解冻
JavaScript中的合成异步处理
Thaw.js通过将长时间的计算分成多个小部分来帮助阻止浏览器冻结,当浏览器不忙时,这些小部分会更自然地处理。 这将模拟异步行为,并尝试使浏览器保持冻结状态。 Thaw.ts解冻冻结的浏览器。
用法
import { thaw } from 'thaw.js' ;
import { matrixMultiply } from 'fake-math-library' ;
let lastMatrix ;
const items = [ ] ;
for ( let i = 0 ; i < 1000000 xss=removed> {
lastMatrix = matrixMultiply ( a , b ) ;
} ) ;
}
// start thawing!
const t = thaw
【文件预览】:
thaw.js-master
----index.html(6KB)
----yarn.lock(171KB)
----src()
--------index.ts(262B)
--------thaw.ts(3KB)
--------block.test.ts(3KB)
--------thaw.test.ts(10KB)
--------block.ts(1KB)
--------test-utils.ts(163B)
--------index.test.ts(713B)
----tsconfig.json(154B)
----LICENSE(1KB)
----jest.config.js(70B)
----README.md(2KB)
----.gitignore(78B)
----package.json(1KB)