normalizr:根据架构归一化嵌套的JSON

时间:2021-01-30 13:24:39
【文件属性】:
文件名称:normalizr:根据架构归一化嵌套的JSON
文件大小:866KB
文件格式:ZIP
更新时间:2021-01-30 13:24:39
redux javascript api flux json 规范化 安装 使用yarn或npm从NPM存储库安装: yarn add normalizr npm install normalizr 动机 无论是否公开,许多API都会返回具有深层嵌套对象的JSON数据。 对于JavaScript应用程序,尤其是那些使用或应用程序,使用这种结构的数据通常非常困难。 解 Normalizr是一个小型但功能强大的实用程序,用于将JSON与模式定义一起使用,并返回嵌套在其字典中的ID及其嵌套实体。 文献资料 例子 快速开始 考虑一个典型的博客文章。 单个帖子的API响应可能如下所示: { " id " : " 123 " , " author " : { " id " : " 1 " , " name " : " Paul " }, " title " : " My awesome blog post " , " comments " : [ { " id " : " 324 " , " commenter " : { " id " : " 2 " ,
【文件预览】:
normalizr-master
----.travis.yml(183B)
----rollup.config.js(807B)
----docs()
--------faqs.md(278B)
--------quickstart.md(1KB)
--------jsonapi.md(913B)
--------api.md(14KB)
--------introduction.md(2KB)
--------README.md(381B)
----.babelrc.js(395B)
----.flowconfig(0B)
----package.json(2KB)
----.github()
--------FUNDING.yml(74B)
--------PULL_REQUEST_TEMPLATE.md(429B)
--------lock.yml(610B)
--------ISSUE_TEMPLATE()
----jest.config.js(66B)
----typescript-tests()
--------entity.ts(1022B)
--------object.ts(632B)
--------relationships.ts(1KB)
--------values.ts(253B)
--------array.ts(494B)
--------github.ts(761B)
--------union.ts(337B)
--------array_schema.ts(504B)
----prettier.config.js(121B)
----LICENSE(1KB)
----CONTRIBUTING.md(1KB)
----src()
--------index.js(4KB)
--------__tests__()
--------schemas()
----.eslintrc.js(4KB)
----index.d.ts(2KB)
----husky.config.js(297B)
----examples()
--------.eslintrc(45B)
--------relationships()
--------redux()
--------github()
----.gitignore(78B)
----CHANGELOG.md(3KB)
----README.md(3KB)
----yarn.lock(285KB)
----.eslintignore(59B)
----lint-staged.config.js(193B)

网友评论