mutation-sentinel:在运行时深度检测对象突变

时间:2021-05-17 05:19:46
【文件属性】:
文件名称:mutation-sentinel:在运行时深度检测对象突变
文件大小:50KB
文件格式:ZIP
更新时间:2021-05-17 05:19:46
javascript proxy immutability mutations JavaScript 突变前哨 突变前哨可以帮助您在运行时深度检测突变,并在代码库中实现不变性。 动机 因此,您决定使用PureComponents优化您的React应用程序,但您也知道,与PureComponents混合使用时, 。 突变前哨使您能够增量地检测和修复代码中的突变,并在此过程中强制实现不变性。 安装 npm install --save mutation-sentinel 用法 包装对象(包括数组)并使用makeSentinel函数检测突变。 使用无法包装的值调用makeSentinel只会返回该值本身。 import makeSentinel from "mutation-sentinel" ; // const makeSentinel = require("mutation-sentinel").default; const obj = { } ; const wrappedObj
【文件预览】:
mutation-sentinel-master
----.gitignore(27B)
----.babelrc(94B)
----.flowconfig(18B)
----package.json(1KB)
----src()
--------isWeakMapAvailable.js(114B)
--------index.js(496B)
--------makeSentinel.js(7KB)
----.eslintrc.yaml(491B)
----.travis.yml(154B)
----CONTRIBUTING.md(1KB)
----CODE_OF_CONDUCT.md(1KB)
----LICENSE(1KB)
----CHANGELOG.md(447B)
----flow-typed()
--------npm()
----README.md(6KB)
----tests()
--------.eslintrc.yaml(19B)
--------index-test.js(14KB)
----.eslintignore(18B)
----.npmignore(26B)
----yarn.lock(119KB)

网友评论