{"expireTime":9007200821600216000,"key":"gatsby-plugin-mdx-entire-payload-66051091c29472c5893516482fc92d6b-","val":{"mdast":{"type":"root","children":[{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"type:","position":{"start":{"line":2,"column":3,"offset":3},"end":{"line":2,"column":8,"offset":8},"indent":[]}}],"position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":10,"offset":10},"indent":[]}},{"type":"text","value":" ","position":{"start":{"line":2,"column":10,"offset":10},"end":{"line":2,"column":11,"offset":11},"indent":[]}},{"type":"inlineCode","value":"(state: {result: *, entities: *}) => *","position":{"start":{"line":2,"column":11,"offset":11},"end":{"line":2,"column":51,"offset":51},"indent":[]}}],"position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":51,"offset":51},"indent":[]}},{"type":"paragraph","children":[{"type":"text","value":"Denormalize is the reverse of normalize. When given a normalized result and a set of entities\nit will reconstruct the data from the entities. You can loosly describe it as:\n","position":{"start":{"line":4,"column":1,"offset":53},"end":{"line":6,"column":1,"offset":226},"indent":[1,1]}},{"type":"inlineCode","value":"a === schema.denormalize(schema.normalize(a))","position":{"start":{"line":6,"column":1,"offset":226},"end":{"line":6,"column":48,"offset":273},"indent":[]}}],"position":{"start":{"line":4,"column":1,"offset":53},"end":{"line":6,"column":48,"offset":273},"indent":[1,1]}},{"type":"paragraph","children":[{"type":"emphasis","children":[{"type":"text","value":"Note: the result shape must match the shape of the schema","position":{"start":{"line":8,"column":2,"offset":276},"end":{"line":8,"column":59,"offset":333},"indent":[]}}],"position":{"start":{"line":8,"column":1,"offset":275},"end":{"line":8,"column":60,"offset":334},"indent":[]}}],"position":{"start":{"line":8,"column":1,"offset":275},"end":{"line":8,"column":60,"offset":334},"indent":[]}},{"type":"code","lang":"js","meta":null,"value":"const person = new EntitySchema('person', {\n    shape: new ObjectSchema({})\n});\nconst people = new ArraySchema(person);\n\npeople.denormalize({\n    result: ['foo', 'bar'],\n    entities: {\n        person: {\n            foo: {id: 'foo', name: 'fooschia'},\n            bar: {id: 'bar', name: 'bartholomew'}\n        }\n    }\n});\n\n/*\n[\n    {id: 'foo', name: 'fooschia'},\n    {id: 'bar', name: 'bartholomew'}\n]\n*/\n","position":{"start":{"line":10,"column":1,"offset":336},"end":{"line":33,"column":4,"offset":751},"indent":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}},{"type":"export","value":"export const _frontmatter = {}","position":{"start":{"line":37,"column":1,"offset":755},"end":{"line":37,"column":31,"offset":785},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":37,"column":31,"offset":785}}},"scopeImports":[],"scopeIdentifiers":[],"rawMDXOutput":"/* @jsx mdx */\nimport { mdx } from '@mdx-js/react';\n/* @jsx mdx */\n\nexport const _frontmatter = {};\nconst makeShortcode = name => function MDXDefaultShortcode(props) {\n  console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\")\n  return <div {...props}/>\n};\n\nconst layoutProps = {\n  _frontmatter\n};\nconst MDXLayout = \"wrapper\"\nexport default function MDXContent({\n  components,\n  ...props\n}) {\n  return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n    <p><strong parentName=\"p\">{`type:`}</strong>{` `}<inlineCode parentName=\"p\">{`(state: {result: *, entities: *}) => *`}</inlineCode></p>\n    <p>{`Denormalize is the reverse of normalize. When given a normalized result and a set of entities\nit will reconstruct the data from the entities. You can loosly describe it as:\n`}<inlineCode parentName=\"p\">{`a === schema.denormalize(schema.normalize(a))`}</inlineCode></p>\n    <p><em parentName=\"p\">{`Note: the result shape must match the shape of the schema`}</em></p>\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`const person = new EntitySchema('person', {\n    shape: new ObjectSchema({})\n});\nconst people = new ArraySchema(person);\n\npeople.denormalize({\n    result: ['foo', 'bar'],\n    entities: {\n        person: {\n            foo: {id: 'foo', name: 'fooschia'},\n            bar: {id: 'bar', name: 'bartholomew'}\n        }\n    }\n});\n\n/*\n[\n    {id: 'foo', name: 'fooschia'},\n    {id: 'bar', name: 'bartholomew'}\n]\n*/\n\n`}</code></pre>\n\n    </MDXLayout>;\n}\n\n;\nMDXContent.isMDXComponent = true;"}}