{"_id":"react-universal-data","_rev":"33-ab71c3376c7d4c416a6efd89e279f637","name":"react-universal-data","dist-tags":{"latest":"4.1.2","next":"4.1.0-3"},"versions":{"2.0.0":{"name":"react-universal-data","version":"2.0.0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.0.0","dist":{"shasum":"c9d28588da1d3e5524eab8f9ffeea6a81d1b3f21","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.0.0.tgz","fileCount":21,"unpackedSize":40667,"integrity":"sha512-Uo7X4vKhSVl7rL9qytMvMcLqlgLfBalktzFLG52lHzXVkuRu+t4axfhsYcIdzEGWGPaHI3QYwi2++9ZByhXu5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyRc6cw5T5OUFdb24dNVk5MH/rziC0sj21JG4Jbi1Y1gIhAOtIQx6Bzfsk2TA3eipms37TI6uajfBHYSeaAnh/+9yY"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.0.0_1530723589532_0.5115286889598027"},"_hasShrinkwrap":false},"2.0.1":{"name":"react-universal-data","version":"2.0.1","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.0.1","dist":{"shasum":"661bb1d3cc87f8aac2d82157412acecfeb690608","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.0.1.tgz","fileCount":21,"unpackedSize":41971,"integrity":"sha512-uGQfW3QeL0b1m6d6FoHg2H8VuTQiM78rWTFGC8o9zDmm5Jp6Vhtch0lmT4jwewuGUiHKr5oh1E1eoZkHj0XnOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCivXUhxMvu+/VftUjMbqXRaipcxkRaqWY/IK5oxGU4BgIhAIMxT6evrBMu9hjkstpPQ2RzkeUP9vPPZk9V/4QGzhNT"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.0.1_1530771100163_0.05452075904172027"},"_hasShrinkwrap":false},"2.1.0":{"name":"react-universal-data","version":"2.1.0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.1.0","dist":{"shasum":"4514e1c3dfcc4c395dbc5161c96314bbe00e01a9","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.1.0.tgz","fileCount":21,"unpackedSize":42810,"integrity":"sha512-vC7xbRuyh2j+5+l0OzbnMeWIB5DAPjdedj3dhUnv1IgMDlP69n19VH+K2vPCB3InyZ3suZpvNjB+61XosSb6vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKxSXIsat7UmLmaxSXHvYB5c3V1xkRFNLillnxzwvzsAiEAkypVlmoK92FcDDUfHDJScBKGK/wkRCOFS/F8R1CInB8="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.1.0_1530790829511_0.9982812401109256"},"_hasShrinkwrap":false},"2.1.1":{"name":"react-universal-data","version":"2.1.1","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.1.1","dist":{"shasum":"d97d33dbc85ae3cae91a964ac08119b54d578026","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.1.1.tgz","fileCount":21,"unpackedSize":42722,"integrity":"sha512-kpaMSmq2QwJTrOm70+Ekmm0rvfmj42fn8V+zY+k7vSQfpUo0fk2HHaCBT5vtRgP/g7cRSB+Vf2Dz0Qj2hc04Mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk9hNEdLqE3ThqtdqSrteEys/u5nXP0krM7Q0FvvOqlwIgFmL1r5DRo3n5I2EXm06TzAwrT+3TKWqsKP6eqKPpcaE="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.1.1_1531768687849_0.7256540326866725"},"_hasShrinkwrap":false},"2.1.2":{"name":"react-universal-data","version":"2.1.2","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.1.2","dist":{"shasum":"c95a3fdbc4272372021d976b934ff130426281af","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.1.2.tgz","fileCount":21,"unpackedSize":43499,"integrity":"sha512-oKceLhl0fDIhiwUHCXa3UfLf8/+AwNbwt9btLxZAVyQuQxb3cqR/jOfzwM3wKxMnkI5VlyFFtwL/fSRRctzcyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUdLnqf/+SqLH81w4QOhLvFLQ6s4KpwUwNfxTNDcTycwIhALotlxvzVhwIiPd298S5RxRQZ9wQYuNLThJU9IZlb5/l"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.1.2_1531920271375_0.9352412538678156"},"_hasShrinkwrap":false},"2.1.3":{"name":"react-universal-data","version":"2.1.3","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","files":["./esm","./cjs"],"tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production BABEL_ENV=modules babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env BABEL_ENV=modules ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"babel":"inherit","verbose":true,"require":["babel-register"]},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"auto-changelog":"^1.7.1","ava":"^0.25.0","babel-cli":"^6.26.0","babel-core":"6.26.3","babel-eslint":"^8.2.3","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cross-env":"5.1.6","documentation":"^8.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.49.3","eslint-plugin-import":"^2.12.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-react":"^7.10.0","eslint-plugin-standard":"^3.1.0","flow-bin":"^0.75.0","husky":"^0.14.3","lint-staged":"^7.1.3","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.1","react-dom":"^16.4.1","react-test-renderer":"^16.4.1","rimraf":"^2.6.2"},"dependencies":{"create-react-context":"^0.2.2","react-tree-walker":"^4.1.0","recompose":"^0.27.1"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.1.3","dist":{"shasum":"bea76f6b8230c58408679977d2ea14e933b8dbec","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.1.3.tgz","fileCount":21,"unpackedSize":50969,"integrity":"sha512-ktNI1cLLJmaMgdvBP7JoABajYX21eud8PDFspGlLfcSSs9quInr1DIwADGy+bDGbpuDfMtffFefqw+0sVKVDUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmxN1jvPO4tCQ82nHcvAY91HPP3VHpBFs6FwWT2LimUAIgZBEDV7ma6z+Zqr3RraR+E08fNNa0ZWeepK20GIN9Wso="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.1.3_1532431762939_0.12339599602628226"},"_hasShrinkwrap":false},"2.2.0":{"name":"react-universal-data","version":"2.2.0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.2","react-dom":"^16.4.2","react-test-renderer":"^16.4.2","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-tree-walker":"^4.3.0","recompose":"^0.30.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.2.0","dist":{"shasum":"b62aa227e5fc79f040289cddd5d1d957295ae567","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.2.0.tgz","integrity":"sha512-ovcBMeYvMCpL3Z5MmOszFzfi+aY3vAvzWyLRzwRc3xeRo9WtkLzUI1oPWhzcMG/rvXm4c0k7nGTMbJdA8gm1ZQ==","fileCount":21,"unpackedSize":43511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjEXeCRA9TVsSAnZWagAAeTkP/2/ADjfhEUV5ZjxloKRD\ny2c3Yh/3Ef516oX6fMCjvkEq6x+/3DU9V3ze2JkGqZBREmKnt9GEM51lNiJv\nlOJltTM8WLDfa4JtPlCzLT4Mno6DszGshkWBpvONBzNhnSdWbidW+ZIstOzA\niO4t2pwzObwf4eQ85JFUnLlLJ1Kt6mUsF2fUvSZzmUedWsP3IfjiFUh0XWmf\n2Dqr9+ZRpMXaTc0jjoDN/XRTZxyqayv4ocPtFnDGbWerhhNBdd4SXQquDr/M\nzJTrzn/EZl2NzO0uBF0fKY6cyrcsoUlNvv7L9mlejtdFJIW+OVwiyw9EYH/T\n9VXA5I6VSDqYdRv6zcyy1kcNSAfeGKQRwBMdW9fuL4CNgX8r2sDtSzk8gGJS\n+S9xd0f+jODG9kQsfeVVHKHMRuXYQXT6ItGmdC22fnekiNAY+urOzQLqZPXD\nmVJfYct04NjjgJSPdmv3Iy7v7cNscXya2pxgX3CtE5/bahF03JrMbmL5x5gW\nqvtFtKG8cuU7k7KL/tXUbNdnvWJtnvXcVd1JIOWNTWrKuYyQpo8z2Ndutx6/\nAyBpdH1hqyRPpyv2E5dUyI/wv4oW0QKTWbNgoUHJCZ/U1T42OFgH+t0PXaqx\nohKTPRDJX4hFwy/k2oMk1CL/7pnIMMnl4D/J9D8cdX4TglQIgOkuTaLBRTvQ\nBF0p\r\n=hHtW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyZmYJHy/+3cCY+5ZagqS2h7/5nal5a6GG+1m2hquWvAiBD0EgMTcnfjTnzGTrrnNjGhbrINSdFYAewbyHzvoNAYg=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.2.0_1535919581996_0.08725252328899935"},"_hasShrinkwrap":false},"2.2.1":{"name":"react-universal-data","version":"2.2.1","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.2","react-dom":"^16.4.2","react-test-renderer":"^16.4.2","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-tree-walker":"^4.3.0","recompose":"^0.30.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.2.1","dist":{"shasum":"f8a17c761b31ec5c926c1a5cc94936aa6013cb64","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.2.1.tgz","integrity":"sha512-PcdX28RAzSTrZIrZNOgfvJHYRJLm3Sob4reSYDV4FA5JCCeXQ7EZpmKVXwL1PhkrRbIs0lqjgYURTMpqDFEXHA==","fileCount":21,"unpackedSize":44440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjOQRCRA9TVsSAnZWagAAi3AP/iQZC4FHEo7T1Mzfw5oF\n70TEzh1Bve5tKLQgb/cj4TTkAZpE8avimccvLXlFk23kcpno8boNVrLePal9\neP3adwygzmS7hdvKcu86fR3g/KGwlChebcokb6e8liG+Ib1S8ZliJDOQ3uS0\nNfOp7iFvtojY7TGqoo0tJArGv+UT5uUzPtjx6/9jsPN/pUPrVW2wARjYMvyh\n0n2K/S1L/WvLB+Aiz2ROKeFBGEmxa6T360KW/0yJ4tySPorEbiZ9DQeGhJLQ\nEvdukSKIF8OYvkI/8omy4qcSyngkd7XQQmabfJ90mUDIzHl2YZY0jN07yws4\n9KK4+NZkt+udlzEKWs5ryAUlzj4qzCjhdHCkPvML/rs6cKez1zkjQDmLldXK\nOb6/mOJz0S/ac1ZKe0AdPtCmOzXK/99JvQFfrkHS8OdiZS+LZA4JTPkTPliw\nLvVKQwkGpvVcbvvTdjTUXDt3icPKZnfIh2GJV3ohNJwiiClz0TX2Wl92bksJ\nEpl7WYsMj9BD0EUAWI2IFb+EoEJblXILv9VZrwx56nl3TKpLmRaONQjDKYVZ\nTWNfmGqr0VpP/5hDdsAC9PhFZJ0aGJmdoJnYdokRInNudeZ60B/Df0yLWgjo\n9Skm2kzhlU9R+Ejzi1p6iy/DgFJCGb6Ro76xvNTHA8Yg3or3dTAFVQhaI3J1\nHj5t\r\n=2NpD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVEb8+K8I/a0YwysJF3NQY7Ai2xDXe04k0oXF9BKPiBAiEAl3S9kSWy+wIwMCSheW1ls+YbyAIK/XGN3bjmg+KYP4E="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.2.1_1535960080930_0.6870174064042633"},"_hasShrinkwrap":false},"2.2.2":{"name":"react-universal-data","version":"2.2.2","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.2","react-dom":"^16.4.2","react-test-renderer":"^16.4.2","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-tree-walker":"^4.3.0","recompose":"^0.30.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.2.2","dist":{"shasum":"078e60a00a8730cc3eb3db066d4c519b0cf4503f","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.2.2.tgz","integrity":"sha512-kCz45azhUO7AFDpWqx8Zq+rSiVWK2YmCBQr1eUrcyPIo7AaFvkrXVnFk7vFZXiaNUSxNGt4wmcgDhT3WrEnoJA==","fileCount":21,"unpackedSize":44800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn+M0CRA9TVsSAnZWagAA660P/1fgTRWGhrbyGdXmAoWN\nyhJt6IKFfGzTmZtsRhF4HSqJ0/s+PYgQG3kWXTpduEw4Pa80wQLVVK0W0SVB\nkOVD59iHc/uFNZDI8qPv1Lu1pBISScr6HfM7eu8nlkD3JSZMOuBMYGo8KpaI\ngDrfTRBdk37rbpc+hq7OH0i2w12ZPpdwfVT41Iy9A0EHYTfR3ojeihVQh4vj\n7ewjbAqA9ODO7v5mBdtrFIRt6mKTTHZhQjQn9rgIecVgXG0BqpNv3mZQ9wah\nKW6+r8pBZTjPkQ4xqwSbX3iZQF40Av6vVQbFFB5meu4GpHwaXPhoi2mtljX7\nbz1tz/xMpdYvcu4/lvJlkZFi3Cn8g4IafEoAButv1cT1m+K2oxDmcbMv+rfO\nTuVHtx2c6RfeJHnJPFvFgqKrx4mEHDjJQ8jXqBFOD8kSNkE32oIvgTLBHuVd\n17F1QDT8hmdfccOpoaN1cZdKVE44uZLzKOQKu4mDREwNAI8Yka49CmvxIQZW\nmuPKzSj8QDI9VGVzhanm4BMNz5MjCDdjkRBwBQHuR32LDijK1NC2rI8VuA/3\nWSSHwKhtqa7OzcivDHvNhg6D9CO7Qvb9pcBTGAo43luB+3jb7qj13WW4lyCG\n1S8P/gqTzvW0uK+9lJLxZw4T//RTSdyVAgwCou3mqxFbVHs1AVIIg2c7DaZ4\nftEE\r\n=lPzz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsHQzb/Ek4pJE8MNps1MlJAVlyWzAvcTBEcTD8epsaFAiA4oY+V1WiuZ1CHDQXW/Yi0d7zzvzwpmL+A2fN8c33ikQ=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.2.2_1537205043083_0.2472993400355652"},"_hasShrinkwrap":false},"2.3.0-0":{"name":"react-universal-data","version":"2.3.0-0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.2","react-dom":"^16.4.2","react-test-renderer":"^16.4.2","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","@exah/react-tree-walker":"^4.3.1","recompose":"^0.30.0"},"readmeFilename":"README.md","readme":"⚠️ React 16.6 is not currently supported (tested). Please use 16.5.\n\n---\n\n# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-tree-walker](https://github.com/ctrlplusb/react-tree-walker) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.3.0-0","dist":{"shasum":"e13e53390f65d693c084031c4b603ac0fefeb595","integrity":"sha512-EYbE+6bKz6QrgkBia66rx6naDU5T5+E6n3HZZH7lMD33IyoMFblwdC7GC7R2eyTIlVobGWy612Eu/hoJH+r1gQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.3.0-0.tgz","fileCount":21,"unpackedSize":45857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcH14RCRA9TVsSAnZWagAACL8QAJ3vSiZB6B6Fd4tUK9nM\n9q/+ywuu9/qZRtf8jTSeiKSW4EBiHngGFyV74dF44v3/o0OK7n9+tUEvAV5o\nQa5G6g8HaS4PKDsegLBOuvzSlZ8AVua1tbRxanqPMs1lPWpY0TulMHfzP4sO\noYGuSG3608OLuG1yHsotFkDPjGzmD4ojrcH6hWRcTs98ywOT/jxWwMordCnq\n/+B1CxaGlB9SnslaiK7JpJIBKOoG3mSDt1/I/tIULg/kBa/iolyyKIQQgNC+\ngbLRnbwcDJNhX88X+XSZPVFiEJ8K2JxuRARGtOyIpEHdkuPcYuKSzA9lpS4l\nC18TOt3b1k7jtNgDEs0hp1edVKxCOow3nR6/W91bZ/3K1TbJoM3YULob54I2\n5iF+g3dK52waJwvC+HUEbbUzbnrXeVTo1jmL+XE1OydTzangEDdfSh5gZDtR\nVFeK+950engzPn2dDhiwnAvENZ74pXctF+Del7NF8jd/D/Km4ixvnB+j2xOv\nKjQne1qQEFNBmarwjdFYPyeMzI6iTlGdxcCfhOSkSTeYXlAUrvuLZvMgj+eH\nCriMszkH4LGa+p3+ZL1xe5n+6MPJ5T8V0/zbZ4TTj5SBmE2eBqx0xB5/eale\nGkxm+qfaWQcmI0wWHPj9n80HLW/M4mG0hfLTP5CRXiPcDpGdLR+9IsJsaC9V\nYxaX\r\n=hf9C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQ5D776FZqtac0JK1hHeZE5PwLUofa8fZj0LDZRi1XLAiEAmIjp/13Ut7R/Cc3oFFmARlt3NLc3FNe6QU3YRdhy9AY="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.3.0-0_1545559568619_0.7432436425430866"},"_hasShrinkwrap":false},"2.3.0":{"name":"react-universal-data","version":"2.3.0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","deploy":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.6.2","react":"^16.4.2","react-dom":"^16.4.2","react-test-renderer":"^16.4.2","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","@exah/react-tree-walker":"^4.3.1","recompose":"^0.30.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@2.3.0","dist":{"shasum":"ed207c192233d55cc866012e7c20ff33e508c514","integrity":"sha512-oV1pT0B7le9e/5iNa+S9W0T0rto9DNC6zezqzGi6KMkr4ppoIqtsN2bBsK/kaHQJz+ljeTX2t4qLRgdNvpz51w==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-2.3.0.tgz","fileCount":21,"unpackedSize":46014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcH7zkCRA9TVsSAnZWagAA2r0P/jMBYVyCowg5MeH6+Um4\n+weaZXBclrSNFdMi2qxpdo65RYuBR4iunXUAp6CTan3V3meBhQ2UFhPTo1GO\nLYTt37cJFntBaUiF6TaOozuY/O4PHN7iCEdzxsyVHfpF9hmAx6mz0d6/HLI3\njv7gfuq3/5mhuTbucVnYG1QG3t3I8cEpVaXYNtdgGBDtvw3QOF7JHqXKq9GS\nTHKTJUMvYsP4keC7Of1kOCpCQLVuZNc7TIg78KkiNVytGVe9Z14XhDMxNulA\n/9DeHqIaPXAWf8k1vR5XzadnVWvzRvAQ/GUzmzMi/l7C2qLgu12DfhnmzS5t\nG88H+8CgmjllOs94+yERygXfkRyh+dyUXrM3n8ea5HFkroGQf5iRGk3SKJH6\nYP+tNQze/SmTeXionw4VIQZyVRvAl5oMl7HlyqyLGifM1421wKdUqzJ7MLfD\n/vtXOEMWT8ysCpdzFMegj9UGUn86GGgV4KX7ChpfPeY/wn+lCL7j6G4JOmnL\nLxA2Sh1lmrNwiEDrOAk2HWY9+HQk/WssYPZhNecaPiDQ57GzMI2nA/y8PjVb\n+RpoF+TCdv1WG3Xt975JjO2L9mKZlXOLm0ACy9Xtf1HRWcWKX68riACSKE1k\nRASdYp/QsR6uaZ5/DRHci0NdxalqVmpCEW7DUHaBBS+wDGJNnwCROjdaLD96\nkYfe\r\n=6mLz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJbYxo42zJ8uNDwZoi9xQ4hk4/2/mCmj96TNg4RbYCEAIhAPGGX8/RPwiYdJoP70sCJKzShBZCPAAhIWQWBkuj4nQR"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_2.3.0_1545583843816_0.9027638785834047"},"_hasShrinkwrap":false},"3.0.0-0":{"name":"react-universal-data","version":"3.0.0-0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","release":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-ssr-prepass":"^1.0.4","recompose":"^0.30.0"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-tree-walker](https://github.com/ctrlplusb/react-tree-walker) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@3.0.0-0","dist":{"shasum":"8b4922ce7672161d7907a7aa58c0906d428b3eb8","integrity":"sha512-KnxmcrrzrlUSy4Uzei2JFDeGJj1cPv4a12b4QwNfufkef66OqhwBhkKaFo+LA0XBwYHl805htTzH5KTOd8aJxg==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-3.0.0-0.tgz","fileCount":21,"unpackedSize":46238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcx2+/CRA9TVsSAnZWagAA9FUQAIxDZsvRAlpR0/UuvIsm\nk42YM7IgNeCHyPypRWRfK6oUrUi6ETfOtPdHrvwpDEl1WKVpAju5kXwvabgK\nutrKzs0lssWuWLtHS0ktti34r3UnG+eEndcHDfmHFLbZt8mXOwERFVAetVOK\nvdUMz4w4EqF7gq/eEW4VmV35b4sGHQPyQgThnVcZyZvrDumqy+zTtGP9TrpG\n4TN/KdXYhI5csCiWZswRZU+U83zvn1G9aoJTnQKhL6V0M92dITusECDkOQ7l\nj2/WLQ81wiBQclGzUogAuwuENW2ViGPV1rdfvz99vIKUlW+mXEWufCKW367A\n0W2HKDVSFL8lCkGeo/5qEFrPj8yCItvjlshmI62AZIrU/EfeOQMnjES3vDRG\nEwz61BzYmu0FD+BlH9y9hcNPZxEAzqMeCwu5oNCNdDZmQG/KV1oZsKLBNjgM\ntWac53nLPqM6KRIWnsdwrpTScmXP3c7mZBzmwz0m/AnGg8pEjM3Q6vZI5jnA\nVpFf5Db3tfvdyMvEhP3IJxC6teCUtUs8ZZQsxSQ6RpTidA0vomJhHP4UeLnt\nh42OGKxTEwd7o04whfDItou3O0IWSOyD2effSvePrid3ucVUV/lBA24xRHaI\n2kqesMaocQXg9xAMvraE+szItPuFG3rHiVO+58IvhmZ4WgSaBXm5vIHOk7gO\nJ53l\r\n=Gfaf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsexC7qJ+vMtmdmBkNL1wYbaH4JdmLMMiXPHpGLGRzCwIhAKiX1KiUeMyju+523Fh3fPKI3VAOOXnCSgWf82ZtY76B"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_3.0.0-0_1556574143140_0.9978914456973844"},"_hasShrinkwrap":false},"3.0.0":{"name":"react-universal-data","version":"3.0.0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","release":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-ssr-prepass":"^1.0.4"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@3.0.0","dist":{"shasum":"2662c5bbfe287fad97ffcd046c8ff25787cf1e73","integrity":"sha512-RyxwcGm1lW4hy04/tJbhjMXVZEL5xcEOPTnNOw4jEDtJSsjO0ACwXY2n63JxUREOD4XqT6Ou5z9LuLSqd2rOmA==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-3.0.0.tgz","fileCount":21,"unpackedSize":45910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyVQ8CRA9TVsSAnZWagAATxsP/2j4WyQnx43sG1KliPVj\nfdQNojFMZucIOCE7Kbg33ZUT8l6b9CTICCoT/OzsTe4De4hPGSVsKJJ5Pvvk\n/4Xj49KpPg3APsMwSAc95XkVcADE9YNSuod77qXcaxomZb5hKlv/gk4Z4aGF\nSB24/5VT1GR+ZgEGx3TB5cZW/gx0wbxyV5bKZURc3+af/f0Y64JSe4lUU+v6\n4E9NuR3wwZEcqDGTpuDkf/aPFK4pHFse0Fkf0x6kwCCqFPGrmSV56TBWpZcB\ndADTJWJvtR5oTWVqSQ5pHYF8y/6sDEzFUQi67u9fZq6v+zVv5kpa5tYUe6SM\nbiKXhbUG4fHsfwbqBYpk86Et9o9eyfGv7pIleJk6I776d/fgmLiKLCVW2aL7\n4YRRhcqxpo9OSic5U0PwwZWStFcOPbH0V4ev0LoCOyP5Y2hANTfky+Coygzz\nHgOvqBPgp/9jr0prz7GQvygsuv+LsDLbSqCZLeR3/DbN9bkvXv9pw28Nx0jM\nCSyx/W6sQTshYQf79MZK1Nhyq1ub6cWi+WpcIeikHz+MP4q3vjANguF3o09y\nEnRXJE1G8LLXBS1vfr1J+l59BfeKIV6YBL76ua786dI+mbT4KtuyITnovaOy\nR/vDNf+8RR7f5M28jHUMpBpDdDIpwRkGnlkUBZ1LkG2EDzVxSeO3JnmObIq/\n531/\r\n=KE9E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCByWo9wlgSN/cOEhCzSOwsrvmwJD3JOBX92s9AyJopkgIgcrNlIpyLwcEAkrCPXwB2TRQK2nXjrABr2yi1IfXsO+E="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_3.0.0_1556698172280_0.6252872610069293"},"_hasShrinkwrap":false},"3.0.1":{"name":"react-universal-data","version":"3.0.1","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"cross-env NODE_ENV=production babel src -d esm","build:cjs":"cross-env NODE_ENV=production MODULES=cjs babel src -d cjs","build:docs":"documentation build -c ./.documentation.yml src/** -f md -o docs/api.md","prebuild":"npm run cleanup","watch":"run-p \"build:* -- -w\" \"test:unit -- -w\"","prewatch":"npm run cleanup","test":"run-s test:*","test:unit":"cross-env MODULES=cjs ava test","test:lint":"eslint src test","test:types":"flow check","release":"np --no-cleanup","cleanup":"rimraf cjs esm","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build","precommit":"lint-staged","prepush":"npm test"},"publishConfig":{"access":"public"},"lint-staged":{"./src/**/*.js":"eslint","./test/**/*.js":"eslint"},"eslintConfig":{"parser":"babel-eslint","extends":["standard","standard-react","plugin:flowtype/recommended"],"plugins":["flowtype"],"rules":{"no-shadow":2}},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"ava":{"verbose":true,"require":["@babel/register"],"babel":{"testOptions":{"extends":"./babel.config.js"}}},"peerDependencies":{"prop-types":"^15.0.0","react":"^16.8.0","react-dom":"^16.8.0","react-is":"^16.8.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/preset-react":"^7.0.0","@babel/register":"^7.0.0","auto-changelog":"^1.8.0","ava":"^1.0.0-beta.8","babel-eslint":"^9.0.0","cross-env":"5.2.0","documentation":"^8.1.2","eslint":"^5.5.0","eslint-config-standard":"^12.0.0","eslint-config-standard-react":"^7.0.2","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.14.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^4.0.0","eslint-plugin-react":"^7.11.1","eslint-plugin-standard":"^4.0.0","flow-bin":"^0.80.0","husky":"^0.14.3","lint-staged":"^7.2.2","np":"3.0.4","npm-run-all":"^4.1.3","prop-types":"^15.7.2","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","rimraf":"^2.6.2"},"dependencies":{"@babel/runtime":"^7.0.0","react-ssr-prepass":"^1.1.2"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@3.0.1","dist":{"shasum":"b746f51ab4c02ce25701b0b7c3cf370abe0cd0e9","integrity":"sha512-CttKZ0s5YNet7Yn7MKvj+9TaDPjtlEQ00T1/eeuHPg4+dSIN7HD5JETxH/LxF2KVAqe3wkRSSdvlZLYEGZznNw==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-3.0.1.tgz","fileCount":21,"unpackedSize":46273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeW5aYCRA9TVsSAnZWagAAYnUP/jqwLUu6OgEiTFT1TNsB\ne7dB1rau7pjlYWYj4pwCgNPxp2y094ilWhDSGkEql4hHW4J6l1t1jLbTqtS/\ne9KIY7/MBBYwjD72/xCZF09+Z7zjRAc9PIHMDzDKCttv7Xlgw3epuPy9pTHo\nEw+X+R9OvpFHEwLBwZxhYy2llIcjvBPjjuBqv8Q8w6/uhXsy23QU0CB8ZGAM\n5WvsJWlYGY3t2W5Gq2YomRjWogcJaqIs3nmXswVzZ1AqgdsC8L8IVCgDd0x5\nwDr392dRsMVv4ju2u8hfjysoF8bKrty6dDPIlXk/jTkxNiK3qMfLbWucmFJ1\nvv/JQvoQ3qG0GxAh7ks4jPvcc7DEPTg6/z911xXnabpwckowXO/dShTjXSl1\nDh1nJIEda0cj8NEQP+NOJrX5fXc3ic+h8FOi5qOHu2826Tamd4evYFpBXNJn\nGVlXcW75aATDRYeH5Zq/LeJpt6GzP7vYg2H1dvSBEl/CRcNZIAWCFNS/OOBA\nVmxSRm42DyMAZCcIVDJTzE2+38eEYeh6WTMO4LXrgR0ijBJ+vhmP2gS5lo2c\nvBBUv2ltWSCIuR1Ky/fA92hsSA9QD7wfyEm1lbVheHatlaJkrcvJOco+4ezv\nfzjtJuKC7Ji1eW9wB4Ja4wjIBmzKDzOw4eRW+KApMiWsPVzYDJrN96+xHc8S\n/pHs\r\n=1w5J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4qY2t6aPrcJB4DHrYHb8EKJ/cSse1D59BFCEgv7kopAiEAuqy87jijByXURoHF+Sc3zESW3XTbXt7kZdLJa1w65z8="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_3.0.1_1583060631764_0.993640488060644"},"_hasShrinkwrap":false},"4.0.0-0":{"name":"react-universal-data","version":"4.0.0-0","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"6Kb"},{"path":"./cjs/index.js","limit":"6Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.0","react-dom":"^16.8.0","react-is":"^16.8.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"@babel/runtime":"^7.8.7","react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-0","dist":{"shasum":"8c25093f731fd8b79f8667ffcaeb728f69ced79d","integrity":"sha512-iBV9bL8zclCjP8BiSYiF332csxGuXqvIjXSbbBTDoJpJq8Jb32apE5OZVwrAKF1H6wVBor7/vY/yP/emurClFQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-0.tgz","fileCount":29,"unpackedSize":48014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebpHYCRA9TVsSAnZWagAAl3cP/20nBu5LsKP5f1rfA7bb\ntSfK0zDPs5kWFcJR2mGUm4vlTZpV+HYS2q/0B3hIAvZFmIggh4XMG3iuXcvq\nXA5gGnFvHjp530Ny4ZbonrRwGheYxPlHpzBBA9q0DhQEh/j3TNUl0Rnm0Chc\nzgwzSkJZ5LMhyFfx3OI1o9X2mYUFc5xbRWwductdGMoseQXJ0nibdKKW6stm\nWo9ebX6YvvJuDlTXe6+39kb1c5ETiG5CxlWs73uIVqoabO0TX8nDCcmJ3U9E\nFmg1I1OMrIurVOEVEghWntME/Y3YEGj9iWdkfUsqXQN3YVUms/9+CJKiUloH\nP+DhLGX6QFFEbRXARp+H8dLkKB1Zuc/icyTVfAokZlBeb6Qy1/n8dPmNdG5R\nj/kWrV1T9XvJYztzoETBAYfPkPGLPahZLnJdW+0MGqQSLJZeysEbOtMje9R4\n/lD+ShzEWWMFG2uosLu8GgxdHqrCqeqNh6KIzS/zS5m7CTkAm59nUVv3md3u\nAMJJZVwG+hH7eirs6c9rGrgOXbxS84hlHUP3JrgJL2uMxUoBR8gN9PwW/BvF\nUfjlr3EjPko2b505dXNbPEAjuJt8UF6KC/bijdweXad/gO4IJNYQTexwZ6gn\nkqobxVFFY3z2WiblUgH98uysKpt8S6YpQ0TUPDcRiw6WDjGXLHOXLL5ch16c\np43D\r\n=fdqi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/2yAn6c0fN4Wd1Lrt0CAoxrfycSNHEDCkKVVCd7ffEAiAOqR0CO9eaq/VgVne6HlmlDvssFOL1NMXmt0Gebjjm8Q=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-0_1584304599672_0.5224981693007849"},"_hasShrinkwrap":false},"4.0.0-1":{"name":"react-universal-data","version":"4.0.0-1","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"6Kb"},{"path":"./cjs/index.js","limit":"6Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.0","react-dom":"^16.8.0","react-is":"^16.8.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"@babel/runtime":"^7.8.7","react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-1","dist":{"shasum":"1173811f5ca4796cddb5564a8c0e8bfcce8665c2","integrity":"sha512-JAJUMaogXOSxR9mTQBEw7b6MpISgSuTnjx9JpYcycqYvG+SMPLApdqmNU7KEWCVEP23e7y/VNJKEDikkjV1ukw==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-1.tgz","fileCount":29,"unpackedSize":47761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebpT+CRA9TVsSAnZWagAAGZ8P/1wSuPq7QLG+ORJpszD8\ncO4ZZmhtcpDK24njwdeUAZ5HxQu5Fdh0gVDpzVFRfa/8RATM7kXrgIKbSw+n\nSysAAU/9AVB1a8N2xttFtPo/JYRb5nvf3NaUb6VFdmaG7xwS0gzSRWLW50c8\ngXtjzP/OtYy8l55xQJga30pn+azrhWdjrxjsgFtHX71wCFh5oXGoee5nkGI+\nE/c2giGZhklfDxIfA0iYirm+5F9yR9xTluHAKRbp/g2X1NBW15OIqtx7g3ci\ngznuv2hso8ftc5SFRjeXDdUSowuKmnz9EoVdEtXgI1Zvby+84UkPej+vjr5/\nOJzWmj5tNF1Y4vabIj6KtnKt5Gx06jr3UlW6MXS48hMs3XxTTrd106Q/hTt7\nbE+GrZB/tUpc8JSLj4f3RPu2L6ee3m3EST2f5AZQcZKjFsuyjXKvVYLswOYc\nQt7d6pKv0dZMEwPbhqGjn3UdoIPuUauRIyFKtP4nrNrChVOr7GObDFkDyKxF\nC8ufI09PE50KoVHNOjRwiuT1+UFMopc0q53f8Q1tPt5nBbL3Bfqq/UNADbCT\nXmarGM9o9AljBwFC9qtrDlZVWLM47desZPIPCfVscBuEo45vrpd3C6qDmyoz\n/fEHAxqbxWo6EvQpNdSsLUyFaMdMmGGau63Fj2wLEDf3Df8baA/aHbdtKjdO\n9JEN\r\n=+vXt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpCkqQk08tjt9MiKkMZ2SfJErjJQV+O0gSpgMg6C6Y8AiBLapT0xo7fjT+IzfmHAADCCgWiXvDCJn9SgyppV/q28w=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-1_1584305406544_0.12263325189872587"},"_hasShrinkwrap":false},"4.0.0-2":{"name":"react-universal-data","version":"4.0.0-2","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"6Kb"},{"path":"./cjs/index.js","limit":"6Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-2","dist":{"shasum":"9189a02c59237b3f569aa499b1ab25b81d045c04","integrity":"sha512-hpY84h0pRpuFuxJzYxuoyFq7m0E5wfvd3J7baaBqaZilRSaf/iH5c1JAwEQixqZzrVrUfdWI0AGq6As0/JY8AQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-2.tgz","fileCount":27,"unpackedSize":36739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebr//CRA9TVsSAnZWagAANaYP/iO8c5M21/wqLwiie7pt\n3ksVayREAvXDRySQEens2Iwny4oOcxg4pPB+1gM4w+rW9HMZT650FpUvjWzS\n1419vEtg/2MbHjGdq905wtNkhpX+Vhq+Imx290VZ+o/0gSlSwWK7AA6Vzo0q\np9X7l7qXRFIl5j2OWGfryflzp3taF2riBrtpKI2LO5Hbygn0FNPvXEKB2Xvt\nZw5E1qcQb2yqa77jVeTmxDiSNRHNsY7eEhPU9U3J1iRzq8snt8FPTRPMxE8t\nqaLKQyPJBEzWQiIZF3rxkd73FKkVhAWEYTpG8R/yFk6TOCOuxMiPb77p/c7m\nEoSoSOSkVaiEXwBMv4vkfS5YZldifRFaQxyX1DajTt4VvhbhkQZKHoqOqy1O\ntSR59TWXmGvdR+0kCTSxepm6vQBtmzU7WZFdirew1Nj/1fnzkU3fjOWb7J8P\nJYWeYNnIhmj94JjZuNhzUZV0e13EAxH9Gg/pfyNwhEpYIoEIn/oj1pmRiSHF\nInTFOGvlJqPoj+P2oCqWiEODnDzIhJxk4hpMqN6sNNUA8jHtTMduRlRFo28Z\nWOceUXnCNlJw22saJde1gLu/YHvf1lmch7nb9Shle11G6gCm3ZgbfnTLskFC\nS8Yx36zBByQ5GFdak2CyRuKcco7NGYh70np0wcxc7fv37x3lRNkT8GapgXU/\nPkR2\r\n=EVWq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEnlnJ6X+do7xJ82bBvt8HOt2nKAgX8vJtYuZ/9E15l5AiAujA1oOJCxTE17tnJJAAj6vrPTwslJVKStgg/F37WM2A=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-2_1584316414999_0.9381942283784828"},"_hasShrinkwrap":false},"4.0.0-3":{"name":"react-universal-data","version":"4.0.0-3","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"6Kb"},{"path":"./cjs/index.js","limit":"6Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-3","dist":{"shasum":"10dd13bea6b5cc98a425dce7236841662736439b","integrity":"sha512-HWrlbYU8zHPZZjZBxuxKS+T9qZmXJZuzAwT84bF0RxUtPtyRJg4w0dsO0i8jpuEtEP2WXKE6Enl47gYrmNqVxQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-3.tgz","fileCount":27,"unpackedSize":36871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebsKRCRA9TVsSAnZWagAADh8P/1df9L/KkcS+V6jOyYEp\nipChLArpIm9qBIEA83nszwS+tq9VgPGwTKpFh8N6DgMYjwxRa/n8oaH8tgqu\nZTkwOhwalP1r62RQkI4ZikHfjbUWmgIyKdIwXtKTD0gqyYbULz47DxYGvsHZ\nXR1iaFiF2p1G2cJTDiKk/3kJf3MMJ5pLe/AqvvoEYx89Lu9Jr/FJMYS/UOhC\n4q/OSUnaH2k/QjDZnMJqnrWsfHweqjMKHOQbF+1xueHaDxDoNjPdpaWVy7dJ\nNNl2w8W7Ccxgywk8WbIde56aNhT/vWZY/cnyTdtqXQw4b7M0ritOqrLkhZyU\npTR5QxUPyLoBI/2gC/IbyTFxr5o14ZhiAl3N9XAZgbyX01h5Fd97LkA5Q6Dk\nV/ypMQYEV94T/jNuxXvGwxAG6vAwLPhJcccWDovINAe/6dOC83KZ5uM84aqC\nyRtJMvxQn4+MUpaieVi3ZUzen2zQ8acbVbYb138XvWb4Ydp1Ocmsb5Itk7gk\nEz7Ksf3fkk6OGdwKpNA5eIVJDY872p6pfK0twdka6jVcyGXl6gaWjeQRqA1U\n1FWIsGRwWD62/fZzXjoraUl+jfHUCLeMHrsHDzOTB1jxeJkXi2Oe7SVkcZq7\nM0egO6uUrqYkPb+OdQ0m7jvP2yXX3VV52YuLqfB9jJw2gpf48XIZ/BhlG/cm\n/cE6\r\n=DCLW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZuzFqphJ3JhAB4zIjP9XUcFp0lAWNbGyce79h2Lkp1AiA516SapRRg3MhH9Y0GYl2/IGIw7jwmnis9/i+e3KnKLg=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-3_1584317073272_0.7499854945726729"},"_hasShrinkwrap":false},"4.0.0-4":{"name":"react-universal-data","version":"4.0.0-4","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","tags":["react","tree","ssr","data","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"6Kb"},{"path":"./cjs/index.js","limit":"6Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-4","dist":{"shasum":"b35892d786fd89639816fcdc062ec7aea20f1e9d","integrity":"sha512-UmhQzEJdGl4Qi7c6MT+HE6h/TKHMhez2MuCBbrQoc+tp2VBTztMTKx173KTKoLykKp571rKeNBhPAdTADyZCeg==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-4.tgz","fileCount":27,"unpackedSize":36973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebsT5CRA9TVsSAnZWagAAXrUP/2kInxla/wuv9rzHBe/P\nsIA5WVrYVC/Gxb8yRuU1jE+55lebvxqXzHOzdaDr5sU+AEFnm2wFDOvIxuCg\nCwWYC7k08quZPBNJIuIB73zk5b9+sACGnO+vDBggLcdgainu+2bKFHd7P//6\nUpuLa4qnji1oigjtAz8tbQVdIhEz1/TmElCTdWjFfSPcDxPHq/Em7L4lDQh4\nX6ySAnWblVrNbkQ7w/WORpRMDf633NFnQou6BdCcwaegnmY8EYzH20TM8Awe\nzRMJQEgGwu+SsGPfM+rhOltButUN4dwAyoxxu9tPsFAcLkE4OPVwQRB86tXg\n8KYzcrNQK3d9COLDETwAtP0lZktnXcxhmlnOdX4rb4BeUwaTPpIOjOyJWFjF\nPR4t+Xn7O8u0iaV5IM6yHDgqBzNsR0jGhNGQMHUOQuQpATc+MWVU2Y40RN3S\nL76A/ztoAEfD7TYR6lSJWvYpUVlMNsUoLmA4GM8NoP2qRPhJtq5dmFDlZnjM\nAp9Hc3SLvuBpfllJDKlXh/hsJ5nDzVRFzSr2DOtFaoL9+nPIidj86sBy6BFT\nG17AI1bppDwX21Q8bb7ejpehW69SsB+G4kkpjfdSvy3dtafwtJAZtqwDm4Rs\nVNpqhgKHNnH2c9R3IthUJNJaJRwEckv6iERM3Q7km6/89aNdFvtZprXFIkZ3\nAHYC\r\n=pP9/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoFTUybq07omGXGE6rwbSu0iD/vjHFNgawEBkapgP0RAiAoxz9bVw+UMCdoAp/z6znHWGn5wJVcWe+nVwmtcw0ZLw=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-4_1584317688975_0.003807679270251274"},"_hasShrinkwrap":false},"4.0.0-5":{"name":"react-universal-data","version":"4.0.0-5","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"tags":["react","tree","ssr","data","hook","suspense","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"name":"[server]","path":"./cjs/index.js","limit":"5.5Kb"},{"name":"[client]","path":"./esm/index.browser.js","limit":"580Kb"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","rimraf":"^3.0.2","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-5","dist":{"shasum":"4c11d43e121fec4669c5ab0304fd82413edd6440","integrity":"sha512-WStl6A0RSOxmu13JpbCilv+6+QwLEqNepnIiShmv+u52q1r/SeEwlHB0rxuYbNQ7lN6q8MdtlTo/ojuPeuu4/g==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-5.tgz","fileCount":35,"unpackedSize":28537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed0w2CRA9TVsSAnZWagAAMr8P/0nI+SyNugL+FsUPsA4o\nXmX38ll6U+/qv00nHJzoRXNl4s6SjvkDe/dC+BZzfPIkyookSf+creIkxQbX\ndbr2mbVB2yabT6949krqrGi+7pjgkCJiQufwufNq2OPymUrqsNkxXo815pQy\nRIOGHPGlLh/STUlc705hHOUEoKVNe1uZsWem0myaV/x3YST05E7hzB0eyDvM\nodZZSQo/at6SBAZY1aUvqZfBsInTd09rukEqzx2179ScK1ggJiuc3C86MiWa\nuMoNafuwSTKm12UnDrGPv7z8LNo2PlpYKn0iQIl7t/1Ntqy3kymaHDLIZXfl\nOHvZmtuynT4nh8yV2i8A6WCIh0fptcVuiAWhd22lxsDOyyT6l94W6of3qiRC\nmp2b2WdEkk2n3Xu5J69QhuqZmUHFa1uA0y/68bsP+dTr09pFqomG//dwrbeq\nUF8eM3V+NSuShe0yV8VqXHJNXnqhWRHfzAtnkVB8apx3F/s+pj1tVlFl8PzZ\nmcMh8DcOEo/mgtYCWz0X3qSW3nn+ZxCU58rErmuLwRQQPQnJv0KQFPeBldGz\nrockWDUuni6b9ddqJtk+MMr0SvR/JI2OO/DTIuFHpwHxKz7xWpic49k8MCLU\n5AJIiesrTbAgMgzShly4TmCNuA/zYijAPaf3kGqZkq5WJomnSgk6ub+F8g9U\nfvEm\r\n=ouXe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIjMvvPYDw4mhnberMTjz6K1tHaYJ9LwTLUymOsAjA8QIgGyq6GdkXDcgn5J2+LOc0XqPFB2mC2O6Z7eRI4iJl6pw="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-5_1584876598382_0.6730606983149185"},"_hasShrinkwrap":false},"4.0.0-6":{"name":"react-universal-data","version":"4.0.0-6","description":"Simple React HOC for getting async data + SSR","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"tags":["react","tree","ssr","data","hook","suspense","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.0.1","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/nock":"^11.1.0","@types/node":"^13.7.1","@types/prettier":"^1.19.0","@types/react":"^16.9.23","@typescript-eslint/eslint-plugin":"^2.23.0","@typescript-eslint/parser":"^2.19.2","abort-controller":"^3.0.0","auto-changelog":"^1.16.2","eslint":"^6.8.0","eslint-config-prettier":"^6.10.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","form-data":"^3.0.0","jest":"^25.1.0","nock":"^12.0.2","node-fetch":"^2.6.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^1.19.1","query-string":"^6.11.0","react":"^16.13.0","react-dom":"^16.13.0","react-is":"^16.13.0","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.0.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n> Simple HOC and utils for getting initial and subsequent async data inside React components\n\n- [x] Promise based\n- [x] Request data inside HOC or React Component `getData` static prop\n- [x] Simple server-side rendering & client state restoration\n- [x] Can handle updates\n\n## Install\n\n```sh\n$ yarn add react-universal-data\n```\n\n## [API](./docs/api.md)\n\n## Example\n\nInside `withData` HOC\n\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nconst Page = ({ user = {} }) => <div>Hello {user.name}!</div>\n\nconst PageWithData = withData(() =>\n  fetch('https://jsonplaceholder.typicode.com/users/1')\n    .then(res => res.json())\n    .then(user => ({ user }))\n)(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit pp98jzr4y7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/pp98jzr4y7)\n\n---\n\nOr with static `getData` prop inside React Component\n\n```js\nimport 'isomorphic-fetch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { withData } from 'react-universal-data'\n\nclass Page extends React.Component {\n  static defaultProps = {\n    user: {}\n  }\n  static async getData() {\n    const user = await fetch(\n      'https://jsonplaceholder.typicode.com/users/1'\n    ).then(res => res.json())\n\n    return {\n      user\n    }\n  }\n  render() {\n    const { user } = this.props\n\n    return <div>Hello {user.name}!</div>\n  }\n}\n\nconst PageWithData = withData()(Page)\n\nReactDOM.render(<PageWithData />, document.getElementById('root'))\n```\n\n[![Edit ovxkz1ojj9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/ovxkz1ojj9)\n\n---\n\n### Server-Side Rendering\n  \nWith two-step rendering on server\n\n```js\n// server.js\n\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { html } from 'common-tags'\nimport App from './app'\n\nexport default () => (req, res) => {\n  const appElement = (<App />)\n\n  getInitialData(appElement)\n    .then((initialData) => {\n      res.send(html`\n        <!DOCTYPE html>\n        <html>\n          <body>\n            <div id=\"app\">${renderToString(appElement)}</div>\n            <script>\n              (function () {\n                window._ssr = ${JSON.stringify({ initialData })};\n              })();\n            </script>\n            <script src=\"/client.js\"></script>\n          </body>\n        </html>\n      `)\n    })\n    .catch((error) => {\n      console.error(error)\n      res.status(500)\n      res.send(`Error: ${error.message}`)\n    })\n}\n```\n\nHydrate `App` and `initialData` in client\n\n```js\n// client.js\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateData } from 'react-universal-data'\nimport App from './app'\n\n// Get server state\nconst { initialData } = (window._ssr || {})\n\n// Restore app state\nhydrateData(initialData)\n\n// Render app\nReactDOM.hydrate((\n  <App />\n), document.getElementById('app'))\n```\n\n\n## Links\n\n- [react-ssr-prepass](https://github.com/FormidableLabs/react-ssr-prepass) - inside `getInitialData`\n- [webpack-hot-server-middleware](https://www.npmjs.com/package/webpack-hot-server-middleware) - server-side entry for webpack\n- [goremykina.com](https://github.com/exah/goremykina) - usage example\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0-6","dist":{"shasum":"1258ea86202aabb071893e3435f4a8553ad5498e","integrity":"sha512-gbUhc8Q1rA6WwUPM3xNYuKI1ngJtP6m7PuVb79Z/t3oTXgIVCxLvTwH+npHacIzmbwxFK1WZjuP8bTezz2Gtjw==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0-6.tgz","fileCount":35,"unpackedSize":27962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed/IfCRA9TVsSAnZWagAAR8IP+wbfV5MTRLZ2RzC9MUV3\n1yXcAzt+hYwf1mvybgqOkpxBDLLGlWcM/AYTWo3zTN+nDv9PhkbW7ZeXuiLx\nS3231ZGCAdr/3lVIJdRnzQtxSdzexx38sChmEDNUPrG0fIM8KXjWVtD7FN5w\nYxh72inl2TNKdxbbjpCA1dNf1MNtz4/+kHRbD8QPrrNzdMrUMpr7HtUs7gwQ\n5v2iFL2qG5rxZyT07bCFfrPmaIHaezm5773xdfMelaOhR1f4gZ/xXNGAJaoE\nq2tS1QIAFbKhByqsui5nKPzO9ivkwfYG7W7guSZbjBHfhO3DRY6kX0ztQrFe\nq6Xd2CUcFgEUPHlVkp+l0GK7C6l4n6OaxPuX7NDHKAvk3LQOTtLuZRHEuZ3m\nQ9qlwx3GcOEloZufgd38u3RqvuNGFOJM34f9d8ncWNiVd/+pkKLLa8oOAsAp\n0c4Uu24YtJkjyp8nxp4Ak4J3IDiXg+FrcNe3h6evxe6MR9Bgy72HfAV9tFss\nFyVsMwpE1E2jhPyf8jHpTSTNzUZeJSOnjTnGTC7J5E1/qyppayzaHZ9YY6rU\nVNNC5E9Y/XSX859CEltEF18hIA3YUf3BTb/WsFuEavBRHv2jRvR1lEg2ru3G\nFcdHGw9cNSackpb60NKsZ+e1Infu4Nm8I2PKNd7JQSxt3Dz9EEsrq1aASQR6\n1H9M\r\n=RrB5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFV8E2VoRaFDODtxuSjD0VocRVclmudqn3vw1LUvkUgaAiEA0MC+kQGCzeoI6L7JCqMDXFz+Xtqh/sqnswnNybFt9Cg="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0-6_1584919070830_0.9421097826739957"},"_hasShrinkwrap":false},"4.0.0":{"name":"react-universal-data","version":"4.0.0","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"tags":["react","tree","ssr","data","hook","suspense","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.4.1","@testing-library/jest-dom":"^5.2.0","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/prettier":"^1.19.1","@types/react":"^16.9.26","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^25.2.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.2","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.4.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.0","dist":{"shasum":"cba10a35d3a2ae651505b1d2a3cf82dd4462fd18","integrity":"sha512-zpjhrCW2+t6pqfxJ4wiGcsYSxuFryfI2MmD9DGJF6VP+Ot9nQxIxzHbjDELtfnWq17Rktis1fqwYQdC+QfSBdQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.0.tgz","fileCount":35,"unpackedSize":30363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef31TCRA9TVsSAnZWagAAOVQP/1phODBdkcEw8vYs1tJj\n2KkpIfwO1TSb7me4q6pgwRapH4IQhDMyyb8R9dNoHJ0EbLCyCioPzna9h9Dk\n6seUJtJ4uYtag+5kHxgHTEulZ6hLZvx029VzHXJYjACdUvLPRe68wlsy+B1d\nDdj2PkVSDX/6nHwHoZEJxgURFyYpZYMCMhLc3oubgmq4zXPJp1gUZxaiqfp3\nFHw4Yb5DXrghzwViBzPFk7RystU3yD80PsgIpyQgLme/FYmr2u4j07Eh/p9c\nzvKb4exlI5SoC5/s7Fa6bGauWAvroUIkTV3vrE2Ag9cJrcafdLw/L44h4Bk7\n6YmyWmn7qqzOawDCNT9oMujUA2DwKO1Jg3NQDlED+y1qnIzLc4kzj6hC1Cv4\nFXrGTrxsgU+4LZyhZsqSkyVVQ3wm8Q6O06F7ENCubq1YMnP/8BDuTIZonzOp\nP+jYSQcW/G5yg1NmhmpQEjdFaIC/zL71u7ti+acuGH0b06GWUuSHvm8fPCk4\nakgrNkAahVJ4Rj/NPZ1FVIN5Q1cImBvMyhOtM8nIOJ2F2vnhtsyosm89zW1E\nmmf4sjdN0K0Gt1QQsNQ0WVu7rphTnFzQStaVbOml15HXkayYBTNlE/zgKGbp\nXgxZhEFTTAE+mu8logSmS8ezxprCxevfj7dFKnTm75lAg+Fei7KbWkaF0dIm\nNrZA\r\n=DRG3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFtn+A0qSBFYJRDn+FvTfE09pRft+NqXc9tSsyy2+F2XAiB1xelTeRp2wg3GqUHwGu8QqUtvz9Gzqd8p3t5filkJbg=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.0_1585413458795_0.47323196439310733"},"_hasShrinkwrap":false},"4.0.1":{"name":"react-universal-data","version":"4.0.1","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"tags":["react","tree","ssr","data","hook","suspense","prefetch"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.4.1","@testing-library/jest-dom":"^5.2.0","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/prettier":"^1.19.1","@types/react":"^16.9.26","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^25.2.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.2","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.4.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.1","dist":{"shasum":"f41afe93a3c2079234bfa3266efc77cdf71d7c1b","integrity":"sha512-AveE0bBJityE3H1YpRyKfD9ioSwr6eJtVYiYxAiYfDBD//lv9PAzXQpeCRR5SrFjotpnpXlWNcXK4GxGAHAyLA==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.1.tgz","fileCount":35,"unpackedSize":30762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef666CRA9TVsSAnZWagAADCMP/0c4hltKz07P8ryKYylf\ntzIfYO0c1AtSyylDl+G8xmDutvKiPRchzslkLXgWXreaBu5HqFoaw/BTaejW\n5tRLUywagmX+S+u64sMqTJma+JAe+ESkVeccAgcBzk416qoryrkSh4f+24mz\nlF1lF9XCGkBDDK0sp0kP7f1nCCymd/IHxTNwPzbtH6KJonRarhJzZ28vG1Xp\nORzd3vcMzz+gfUF+CoLUvW3D8tsaRk+4mk6PIF+BF3tfK8qcpRRs6E49H2zJ\nqRbx+GfB+WspsODm8btUZl4Lm/n1FPMy4zFZnhcL1T88YfnGcwMjLaluAKtu\nvfJ0BTBPb9H9w8kep3qHEErk/v6Iut50Eg0aLilEahkm4JAr4APKr9PGBnhj\n0PDOBTvcccCBfpDsHvo45g3k2uG9wrrNPnEwwRQH3SLjZWjiPAukwP5Dfu23\nAESmh9GSjrtD6f9Whix9ViYDptf1ve0cSBeKlF32Xk746ai4hHiJM+vWsqZ1\nxcvMgMAsbsYspWOYKooqzEna/aP2oJVMeCdIEY5OL3o7fdQd6aLaBBH93t45\nsELQrk6GhcrS3pvJ3XFDgwyc6KPb5sj+Khq6nKcNjrdXhd1mgqMAsDGsd8cf\n08YEuXwrYNbRQj/bQyJwD00wsuSJHNBTwE/BYWCXyXe1+O05RLAYdox0r5/X\nVoan\r\n=6GgE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPy8Yn9++lMz//WotqlE8DOmN7qvWTfGte/AppfbBYTAIhAO8xFEJMPNEr7Un8K69qUxlRmIeuBXMwfNjaN4fobfrS"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.1_1585426106024_0.7947150685818476"},"_hasShrinkwrap":false},"4.0.2":{"name":"react-universal-data","version":"4.0.2","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.4.1","@testing-library/jest-dom":"^5.2.0","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/prettier":"^1.19.1","@types/react":"^16.9.26","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^25.2.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.2","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.4.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.0.2","dist":{"shasum":"7555989e52d5be02c6d3ed48ccb01cc0dad48366","integrity":"sha512-hVu9P8EUnJKCfWfWKCZPwIOPKMt39UlzxfL2sGTyBSnAj2earq/G2NhFUTANXI9Tcq6rxLQHcNKUknp0eMR+Tg==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.0.2.tgz","fileCount":35,"unpackedSize":32336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepcpJCRA9TVsSAnZWagAAg70QAIQ8IGh179/AyEu58xoN\nNuAxfnVBPXMGfuB+1QL+DbmN3alwJx3UCIZrWczuWY6E1TyelgXB5Oc63+si\n4CsQipAqHQGfPWiY7epMbBKqfQnj3GjjqFvqY7z7PBySqeAXYv7GyjT6LGhO\nwlLTUi7ze8WhL/RxZs2/AT8/dKUA9yaJQD1qEevt4S9rewHqtmjiQdLF2RPI\n4+28EGyZNaMEiuTPbkcn8lLa/c9aTL/EXTH+3zDiCtIgEyFze94/KGLR5cIi\nbuDGK/PltwmJPVzgzpdLgY3vejqDzh3SBIwSGyrJoRr7/JTwVLAN8me1AM6K\n5q4oXB5QyVGxyRg6Ke5gmL9+vcepeQf9jPgxg5bZ+Vo4s5wnwwHWcpsgsEU5\nqWdWWyNIXTq+IMCdGzN5/SflgQFNA6fEjFQwD5JsGQVmmiqV8vtnvu/DTvG7\n1PHLufuyO+3Ji2QZvAAgJuq+/faEJ/YhkfljwiqmaZk2ol+9/qGrcwPj1+7v\nWfDSlNEVjy7hZH89LuLLZNIUadtrC7xb49GaxV7ezmhiZEctiGvfyq3MAspT\nz38gD3Xl+2KwJgtuCivWw+NxzX+2TVl8ovnuVWB0hfRPL/um9AMrP4OjU0zW\nS1pTAoA2L6NWA1zumONC6H3DftH30EXLeZbtyJw5mJAnvfyT3hgSAp4DrPtT\nL8Xn\r\n=djxf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGdoEvblmGMPVZ9AaMcgOaAHCI0tZD5QzCT9uxawBTlpAiBh4NTSrfkTPA2x8DVcanUzs336pPaAYcp/VveYUeY2RQ=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.0.2_1587923529013_0.5953987353870231"},"_hasShrinkwrap":false},"4.1.0-0":{"name":"react-universal-data","version":"4.1.0-0","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"750B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.4.1","@testing-library/jest-dom":"^5.2.0","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/prettier":"^1.19.1","@types/react":"^16.9.26","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^25.2.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.2","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.4.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n[![](https://flat.badgen.net/npm/v/react-universal-data?cache=600)](https://www.npmjs.com/package/react-universal-data) [![](https://flat.badgen.net/bundlephobia/minzip/react-universal-data?cache=600)](https://bundlephobia.com/result?p=react-universal-data) ![](https://flat.badgen.net/travis/exah/react-universal-data?cache=600)\n\n#### Easy to use hook for getting data on client and server side with effortless hydration of state\n\n- [x] Only 600B minified and gziped\n- [x] Simple hooks API\n- [x] TypeScript\n- [x] Can handle updates\n- [x] [Suspense](http://reactjs.org/docs/concurrent-mode-suspense.html) on server side via [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) 💕\n\n> _This is a NO BULLSHIT hook: just PLUG IT in your components, get ALL THE DATA you need (and some more) both CLIENT- and SERVER-side, HYDRATE that ~~bastard~~ app while SSRing like it's NO BIG DEAL, effortlessly PASS IT to the client and render THE SHIT out of it_\n>\n> [@razdvapoka](https://github.com/razdvapoka)\n\n## 📦 Install\n\n```sh\n$ npm i -S react-universal-data\n```\n\n```sh\n$ yarn add react-universal-data\n```\n\n## 📖 Docs\n\n### `useFetchData`\n\nRequests data and preserves the result to the state.\n\n```ts\ntype useFetchData<T> = (\n  // async function that can return any type of data\n  fetcher: (id: string, context: { isServer: boolean }) => Promise<T>,\n  // unique id that will be used for storing & hydrating data while SSR\n  id: string\n) => AsyncState<T>\n```\n\n> ⚠️ The `id` must be unique for the whole application.\n\nReturned object can be in 4 different forms – depending on the promise's state.\n\n```ts\nexport type AsyncState<T> =\n  // initial\n  | { isReady: false; isLoading: false; error: null; result: undefined }\n  // fulfilled\n  | { isReady: true; isLoading: false; error: null; result: T }\n  // pending\n  | { isReady: boolean; isLoading: true; error: Error | null; result?: T }\n  // rejected\n  | { isReady: false; isLoading: false; error: Error; result?: T }\n```\n\n<details><summary>👀 Fetch a sample post via <a href=\"https://jsonplaceholder.typicode.com\">jsonplaceholder.typicode.com</a> API</summary>\n\n```js\nimport React from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nconst fetchPost = (id) =>\n  fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)\n    .then((response) => response.json())\n\nfunction Post({ id }) {\n  const { isReady, isLoading, result, error } = useFetchData(fetchPost, id)\n\n  if (isLoading) {\n    return <p>Loading...</p>\n  }\n\n  if (error) {\n    return <p>Oh no: {error.message}</p>\n  }\n\n  // You can depend on `isReady` flag to ensure data loaded correctly\n  if (isReady) {\n    return (\n      <article>\n        <h2>{result.title}</h2>\n        <p>{result.body}</p>\n      </article>\n    )\n  }\n\n  return null\n}\n```\n</details>\n\nAs the hook depends on the `fetcher` function identity to be stable, please, wrap it inside `useCallback` or define it outside of the render function to prevent infinite updates.\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction UserPosts({ userId }) {\n  const fetchPosts = useCallback(() => (\n    fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n      .then((response) => response.json())\n  ), [userId]) // will pereform update if value changed\n\n  const { result = [] } = useFetchData(fetchPosts, 'user-posts')\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n\n<details><summary>👀 Create a custom hook for it</summary>\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction useFetchUserPosts(userId) {\n  return useFetchData(\n    useCallback(() => (\n      fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n        .then((response) => response.json())\n    ), [userId]),\n    'user-posts'\n  )\n}\n\nfunction UserPosts({ userId }) {\n  const { result = [] } = useFetchUserPosts(userId)\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n</details>\n\n### `getInitialData`\n\nHandles `useFetchData` on server side and gathers results for [hydration](#hydrateInitialData) in the browser.\n\n```ts\ntype getInitialData = (element: JSX.Element) => Promise<[string, any][]>\n```\n\n```js\n// server.js\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nasync function server(req, res) {\n  const element = <App />\n\n  const data = await getInitialData(element).catch((error) => /* handle error */)\n  const html = renderToString(\n    <html>\n      <body>\n        <div id='app'>{element}</div>\n        <script\n          dangerouslySetInnerHTML={{\n            __html: `window._ssr = ${JSON.stringify(data)};`,\n          }}\n        />\n        <script src='/client.js' />\n      </body>\n    </html>\n  )\n\n  res.write('<!DOCTYPE html>')\n  res.write(html)\n  res.end()\n}\n```\n\n### `hydrateInitialData`\n\nHydrates initial data gathered with [`getInitialData`](#getInitialData) before rendering the app in the browser.\n\n```ts\ntype hydrateInitialData = (initial: [string, any][]) => void\n```\n\n```js\n// client.js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nhydrateInitialData(window._ssr || [])\nReactDOM.hydrate(<App />, document.getElementById('app'))\n```\n\n\n## 💻 Demo\n\n[![Edit react-universal-data-ssr](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-universal-data-ssr-jp9el?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=dark)\n\n## 🔗 Related\n\n### Packages\n\n- [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) - server-side dependency\n- [`ya-fetch`](https://github.com/exah/ya-fetch) - a lightweight wrapper around `fetch`\n\n### Real world usages\n\n- [kayway.me](https://github.com/exah/kayway)\n- [goremykina.com](https://github.com/exah/goremykina)\n- [strelkamag.com](https://strelkamag.com)\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.0-0","dist":{"shasum":"0c8af54dd809166c6fdd74365fc07f6eb9180b8d","integrity":"sha512-EzhyE3pNizB0n5ZMw9OS4FogpsNoQeQy7YAq2OCMh6+bGAwTKhP/A1TXyLpU+PMsOgxkX7+RVLvP+tMwOyUGEA==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.0-0.tgz","fileCount":35,"unpackedSize":36626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes+4TCRA9TVsSAnZWagAAv6AQAJmtLCLBSaDZuBb9RW6F\nmVQqCch8q3ECGfDTEv87iMnZwNVduLmY2giBl2XNRNYXHw7ITTvbIIDWGmfc\nqhO+jvJAUIkHrd6Upj8yYGT3E7rQzV9niSvAcm5jFv3RDW4wUA/JCnXV7Stw\nWoP/24afudhy3S+nGqjz5QGjT41fVHeVNfk7f5TE5cyua2ix7fQuxErVTHwk\nRV04FynE11XVPMIHVmh1MVPTW9OlvkPtevIbPocgtb/2nU8wPrRNzZgE+HdK\nDZEJhRl/zrlojcqwtYgnQ1zyTdsBiEgAEavAmk2zsnmEYQdFY9qgVhRzIq2H\neJzAAtkxQjxzUJXMYc6JMgrHLqIa8LH78TEz3JO8FAge3lnMwE8Mx0/MMMsN\nRfSzh4/PUJcTF8V3KQXnqwuImQ6Fo7hA5hnVeh7ULy90OXhgaag6C9mNq3tb\nBiC9sByCJAw0KHL269q36Yc8Dnq6gceKGB4JaH/YzHpBv+c0v14Z/D2R+uDz\nq5a2h9tatiSzE3R6uie2aiOozXWYevsEjLhOAuz+FGghXELB9M0xVlTqPgR3\nOlup9r02iUWheNmIqJN61xWIYVaMMWKNa/3QgX6MpvWWzjonhBxKzwB/Tezu\nWA8IbgwE4y/PV/fh/dPCj4cJEejbcPGXYlfwPdKa6H3bHgblns8yZZQHAOP9\nAoya\r\n=pH2W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqgIEm7DDqMglSecDxbDIG90NLFsAn2dIMZnOc/KlzagIgLiyQoCzboz+FoySund4e6vdEuBe/AqMSNQi5vIr4JVY="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.0-0_1588850194711_0.24031375059790205"},"_hasShrinkwrap":false},"4.1.0-1":{"name":"react-universal-data","version":"4.1.0-1","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"700B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.4.1","@testing-library/jest-dom":"^5.2.0","@testing-library/react":"^10.0.1","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.1.8","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.1.2","@types/prettier":"^1.19.1","@types/react":"^16.9.26","@typescript-eslint/eslint-plugin":"^2.25.0","@typescript-eslint/parser":"^2.25.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.7.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^25.2.0","np":"^6.0.0","npm-run-all":"^4.1.5","prettier":"^2.0.2","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.4.1","ts-jest":"^25.2.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.1.2"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n[![](https://flat.badgen.net/npm/v/react-universal-data?cache=600)](https://www.npmjs.com/package/react-universal-data) [![](https://flat.badgen.net/bundlephobia/minzip/react-universal-data?cache=600)](https://bundlephobia.com/result?p=react-universal-data) ![](https://flat.badgen.net/travis/exah/react-universal-data?cache=600)\n\n#### Easy to use hook for getting data on client and server side with effortless hydration of state\n\n- [x] Only 600B minified and gziped\n- [x] Simple hooks API\n- [x] TypeScript\n- [x] Can handle updates\n- [x] [Suspense](http://reactjs.org/docs/concurrent-mode-suspense.html) on server side via [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) 💕\n\n> _This is a NO BULLSHIT hook: just PLUG IT in your components, get ALL THE DATA you need (and some more) both CLIENT- and SERVER-side, HYDRATE that ~~bastard~~ app while SSRing like it's NO BIG DEAL, effortlessly PASS IT to the client and render THE SHIT out of it_\n>\n> [@razdvapoka](https://github.com/razdvapoka)\n\n## 📦 Install\n\n```sh\n$ npm i -S react-universal-data\n```\n\n```sh\n$ yarn add react-universal-data\n```\n\n## 📖 Docs\n\n### `useFetchData`\n\nRequests data and preserves the result to the state.\n\n```ts\ntype useFetchData<T> = (\n  // async function that can return any type of data\n  fetcher: (id: string, context: { isServer: boolean }) => Promise<T>,\n  // unique id that will be used for storing & hydrating data while SSR\n  id: string\n) => AsyncState<T>\n```\n\n> ⚠️ The `id` must be unique for the whole application.\n\nReturned object can be in 4 different forms – depending on the promise's state.\n\n```ts\nexport type AsyncState<T> =\n  // initial\n  | { isReady: false; isLoading: false; error: null; result: undefined }\n  // fulfilled\n  | { isReady: true; isLoading: false; error: null; result: T }\n  // pending\n  | { isReady: boolean; isLoading: true; error: Error | null; result?: T }\n  // rejected\n  | { isReady: false; isLoading: false; error: Error; result?: T }\n```\n\n<details><summary>👀 Fetch a sample post via <a href=\"https://jsonplaceholder.typicode.com\">jsonplaceholder.typicode.com</a> API</summary>\n\n```js\nimport React from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nconst fetchPost = (id) =>\n  fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)\n    .then((response) => response.json())\n\nfunction Post({ id }) {\n  const { isReady, isLoading, result, error } = useFetchData(fetchPost, id)\n\n  if (isLoading) {\n    return <p>Loading...</p>\n  }\n\n  if (error) {\n    return <p>Oh no: {error.message}</p>\n  }\n\n  // You can depend on `isReady` flag to ensure data loaded correctly\n  if (isReady) {\n    return (\n      <article>\n        <h2>{result.title}</h2>\n        <p>{result.body}</p>\n      </article>\n    )\n  }\n\n  return null\n}\n```\n</details>\n\nAs the hook depends on the `fetcher` function identity to be stable, please, wrap it inside `useCallback` or define it outside of the render function to prevent infinite updates.\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction UserPosts({ userId }) {\n  const fetchPosts = useCallback(() => (\n    fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n      .then((response) => response.json())\n  ), [userId]) // will pereform update if value changed\n\n  const { result = [] } = useFetchData(fetchPosts, 'user-posts')\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n\n<details><summary>👀 Create a custom hook for it</summary>\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction useFetchUserPosts(userId) {\n  return useFetchData(\n    useCallback(() => (\n      fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n        .then((response) => response.json())\n    ), [userId]),\n    'user-posts'\n  )\n}\n\nfunction UserPosts({ userId }) {\n  const { result = [] } = useFetchUserPosts(userId)\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n</details>\n\n### `getInitialData`\n\nHandles `useFetchData` on server side and gathers results for [hydration](#hydrateInitialData) in the browser.\n\n```ts\ntype getInitialData = (element: JSX.Element) => Promise<[string, any][]>\n```\n\n```js\n// server.js\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nasync function server(req, res) {\n  const element = <App />\n\n  const data = await getInitialData(element).catch((error) => /* handle error */)\n  const html = renderToString(\n    <html>\n      <body>\n        <div id='app'>{element}</div>\n        <script\n          dangerouslySetInnerHTML={{\n            __html: `window._ssr = ${JSON.stringify(data)};`,\n          }}\n        />\n        <script src='/client.js' />\n      </body>\n    </html>\n  )\n\n  res.write('<!DOCTYPE html>')\n  res.write(html)\n  res.end()\n}\n```\n\n### `hydrateInitialData`\n\nHydrates initial data gathered with [`getInitialData`](#getInitialData) before rendering the app in the browser.\n\n```ts\ntype hydrateInitialData = (initial: [string, any][]) => void\n```\n\n```js\n// client.js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nhydrateInitialData(window._ssr || [])\nReactDOM.hydrate(<App />, document.getElementById('app'))\n```\n\n\n## 💻 Demo\n\n[![Edit react-universal-data-ssr](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-universal-data-ssr-jp9el?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=dark)\n\n## 🔗 Related\n\n### Packages\n\n- [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) - server-side dependency\n- [`ya-fetch`](https://github.com/exah/ya-fetch) - a lightweight wrapper around `fetch`\n\n### Real world usages\n\n- [kayway.me](https://github.com/exah/kayway)\n- [goremykina.com](https://github.com/exah/goremykina)\n- [strelkamag.com](https://strelkamag.com)\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.0-1","dist":{"shasum":"ed07ec56e48f96be15fadea569c12fde655c21e3","integrity":"sha512-VvkH2UEktqXe92ICW1EXakL4uX/PiSsJ9ixYzLkA+3bmm1qYQuCtZTpc30F31j7OZj/KlJdu9QGUQ6OIdXWgCw==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.0-1.tgz","fileCount":35,"unpackedSize":36211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetaWUCRA9TVsSAnZWagAADoYP/AvkF08Ai/POXetGZ7kN\nzHmwQyQVpfn/zjo+638yqDUnrpBd12WugvWdVXrfYkDCe6LaMRaij8NWM6fL\nnZeKCY3BrZ3zWujcMftAXNp8/nB4KdFYQM5z/2qVqKHCtQYlr6Q09Vh5st6S\nXge5HohCdBUD6IKOCQ54OH0AlWnMJKY/Co7f+/7puThcvK4DqkQNzSAE+VuV\n7Dmmez0ahnFJtolGbiVsRsPuW26YuwoWeRIUb1kSt3vu1gCQX2iFCUr7+mTA\n/j5WnzBpxGWnJlKmQpNOfvwvwNC2Ume3MNSE5/jns3ewxyRbnSBpmBGXCN3n\nyntSoYoVdt28Uvr+MuKHU+W+ubqe4yseaAabFfQTL4pN2mwAc+3vhJCE5bSB\nkNzviPhtvxPVu32HrJqeeKcx/cnDevKtEFCYcD1oMQyAaQNt/nUsi1DujWFp\nMvO1/8I2csKtIBwlZD5JqYCJDJ+kpvoKrWZFr6QRQT3JCdyx0vMb1cAW6kgH\nN0k5XvqQ6ohs9mVcSrdGJY/qhkeS7ZXLwansjfUPWM9Mm7GOPPKFELD7sL+V\nIK6azxBstCIBo5qgrkk+dh124V24db+ntJ9NBWH34ZTUu1qZ/XCA1ZRhFI6d\nFNLJ76xIHyAVcWUi/Olf8KwQFfBfjIa5ldW6h45VDWVCJN2ljjs12f76G7Mu\nW09N\r\n=Gp+4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDq1DlLc2bLDfhwLYd7VIVDS+kQi7F56pXf5tRY17i9bgIhANNqMsICEYtFXr+v06Qh8/r49ecf05pbYD9CN1X3DdMP"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.0-1_1588962707815_0.928351098022774"},"_hasShrinkwrap":false},"4.1.0-2":{"name":"react-universal-data","version":"4.1.0-2","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"650B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.5.0","@testing-library/jest-dom":"^5.7.0","@testing-library/react":"^10.0.4","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.8.0","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.2.1","@types/prettier":"^2.0.0","@types/react":"^16.9.34","@typescript-eslint/eslint-plugin":"^2.31.0","@typescript-eslint/parser":"^2.31.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.9.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^26.0.1","np":"^6.2.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.5.0","ts-jest":"^25.5.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.2.0"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n[![](https://flat.badgen.net/npm/v/react-universal-data?cache=600)](https://www.npmjs.com/package/react-universal-data) [![](https://flat.badgen.net/bundlephobia/minzip/react-universal-data?cache=600)](https://bundlephobia.com/result?p=react-universal-data) ![](https://flat.badgen.net/travis/exah/react-universal-data?cache=600)\n\n#### Easy to use hook for getting data on client and server side with effortless hydration of state\n\n- [x] Only 600B minified and gziped\n- [x] Simple hooks API\n- [x] TypeScript\n- [x] Can handle updates\n- [x] [Suspense](http://reactjs.org/docs/concurrent-mode-suspense.html) on server side via [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) 💕\n\n> _This is a NO BULLSHIT hook: just PLUG IT in your components, get ALL THE DATA you need (and some more) both CLIENT- and SERVER-side, HYDRATE that ~~bastard~~ app while SSRing like it's NO BIG DEAL, effortlessly PASS IT to the client and render THE SHIT out of it_\n>\n> [@razdvapoka](https://github.com/razdvapoka)\n\n## 📦 Install\n\n```sh\n$ npm i -S react-universal-data\n```\n\n```sh\n$ yarn add react-universal-data\n```\n\n## 📖 Docs\n\n### `useFetchData`\n\nRequests data and preserves the result to the state.\n\n```ts\ntype useFetchData<T> = (\n  // async function that can return any type of data\n  fetcher: (id: string, context: { isServer: boolean }) => Promise<T>,\n  // unique id that will be used for storing & hydrating data while SSR\n  id: string\n) => AsyncState<T>\n```\n\n> ⚠️ The `id` must be unique for the whole application.\n\nReturned object can be in 4 different forms – depending on the promise's state.\n\n```ts\nexport type AsyncState<T> =\n  // initial\n  | { isReady: false; isLoading: false; error: null; result: undefined }\n  // fulfilled\n  | { isReady: true; isLoading: false; error: null; result: T }\n  // pending\n  | { isReady: boolean; isLoading: true; error: Error | null; result?: T }\n  // rejected\n  | { isReady: false; isLoading: false; error: Error; result?: T }\n```\n\n<details><summary>👀 Fetch a sample post via <a href=\"https://jsonplaceholder.typicode.com\">jsonplaceholder.typicode.com</a> API</summary>\n\n```js\nimport React from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nconst fetchPost = (id) =>\n  fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)\n    .then((response) => response.json())\n\nfunction Post({ id }) {\n  const { isReady, isLoading, result, error } = useFetchData(fetchPost, id)\n\n  if (isLoading) {\n    return <p>Loading...</p>\n  }\n\n  if (error) {\n    return <p>Oh no: {error.message}</p>\n  }\n\n  // You can depend on `isReady` flag to ensure data loaded correctly\n  if (isReady) {\n    return (\n      <article>\n        <h2>{result.title}</h2>\n        <p>{result.body}</p>\n      </article>\n    )\n  }\n\n  return null\n}\n```\n</details>\n\nAs the hook depends on the `fetcher` function identity to be stable, please, wrap it inside `useCallback` or define it outside of the render function to prevent infinite updates.\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction UserPosts({ userId }) {\n  const fetchPosts = useCallback(() => (\n    fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n      .then((response) => response.json())\n  ), [userId]) // will pereform update if value changed\n\n  const { result = [] } = useFetchData(fetchPosts, 'user-posts')\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n\n<details><summary>👀 Create a custom hook for it</summary>\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction useFetchUserPosts(userId) {\n  return useFetchData(\n    useCallback(() => (\n      fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n        .then((response) => response.json())\n    ), [userId]),\n    'user-posts'\n  )\n}\n\nfunction UserPosts({ userId }) {\n  const { result = [] } = useFetchUserPosts(userId)\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n</details>\n\n### `getInitialData`\n\nHandles `useFetchData` on server side and gathers results for [hydration](#hydrateInitialData) in the browser.\n\n```ts\ntype getInitialData = (element: JSX.Element) => Promise<[string, any][]>\n```\n\n```js\n// server.js\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nasync function server(req, res) {\n  const element = <App />\n\n  const data = await getInitialData(element).catch((error) => /* handle error */)\n  const html = renderToString(\n    <html>\n      <body>\n        <div id='app'>{element}</div>\n        <script\n          dangerouslySetInnerHTML={{\n            __html: `window._ssr = ${JSON.stringify(data)};`,\n          }}\n        />\n        <script src='/client.js' />\n      </body>\n    </html>\n  )\n\n  res.write('<!DOCTYPE html>')\n  res.write(html)\n  res.end()\n}\n```\n\n### `hydrateInitialData`\n\nHydrates initial data gathered with [`getInitialData`](#getInitialData) before rendering the app in the browser.\n\n```ts\ntype hydrateInitialData = (initial: [string, any][]) => void\n```\n\n```js\n// client.js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nhydrateInitialData(window._ssr || [])\nReactDOM.hydrate(<App />, document.getElementById('app'))\n```\n\n\n## 💻 Demo\n\n[![Edit react-universal-data-ssr](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-universal-data-ssr-jp9el?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=dark)\n\n## 🔗 Related\n\n### Packages\n\n- [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) - server-side dependency\n- [`ya-fetch`](https://github.com/exah/ya-fetch) - a lightweight wrapper around `fetch`\n\n### Real world usages\n\n- [kayway.me](https://github.com/exah/kayway)\n- [goremykina.com](https://github.com/exah/goremykina)\n- [strelkamag.com](https://strelkamag.com)\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.0-2","dist":{"shasum":"06f964b833829e59b21f11a577b37e2e5a0d5fda","integrity":"sha512-atLrDetwJLCUpXSkFB6ob3ga4uPgvhzooML3DE1xZ/DiZC1YqoumisLV2fz1rrp/4TNwRMdIKsIOyHefjTonkA==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.0-2.tgz","fileCount":35,"unpackedSize":36587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetcQwCRA9TVsSAnZWagAA7pEQAKAaLQNoL7xzeSeCT6Zq\nN7R13kg03ILzYO4VKmMqQdEbe8XM9OFCkHbMcw4aM4RHfDKMDS3jvgZVaFwz\nhYN69wOyOoHL5ZdrAW+MasRCNF2s+6c/+3t7DoDvt9uu0RpDIVrQDSXHMCNh\nSy9kQ8EhCegw61V8vlDuv4uSfVik/Yd6Lhk5FQAfvwfqv8G6tI9hnOXwh4Xl\nE4CcGWeOqXS/wKDtBBA66zXEUil3VXudh1Mz/0fb4SYsVOb2HdK+quASAvCU\nAGKTnbrRY+9YMFApbcmCobzaJEypiUO2bSWm33AbaW/YL1ndpy1ZWhnsWmSM\nigC5ePwwrFbxSeHA7kI8StStenGwd0M+FK2wBmfBFc3jDt70rpKZAsGAON7d\nDoDDdbqNOeq2PPmP927/zEFD8IIcXeUfNp5ZJg6Kow8RTIrc9i/pa3EzyYS7\njEbICW1hbSMHi/mFm6Jfb5iTfge+7yGi9OKe9o9D3lhMl7rGST1neI+h/deL\nIxCdkgMIMZ9msyw+KOoxWAug2c3bMqvJ2gq1i8lS2Dn64H0gnLZXnr9HNPA5\nVgXh4gxmhzk5+zDYWw3Ljr3CilaIwLnBCV1JfNS3bnoTYUMbxNKXStGILRbb\nnE8UpEAn8Y9NqyY5+niLa1WPJwE+RnPw74gdAeWfAd1+SQ8GE1zvok3l2dFI\nkDio\r\n=v+h/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/A4D8OqOAH0ZN0flhR5ePTuh7Kex6jvFQLoPtolEiXAiAB1JFt1WLikogkHBvMhRDdmLR+QzStO0x2HubtIZTGEA=="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.0-2_1588970543597_0.0868221897529271"},"_hasShrinkwrap":false},"4.1.0-3":{"name":"react-universal-data","version":"4.1.0-3","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"650B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.5.0","@testing-library/jest-dom":"^5.7.0","@testing-library/react":"^10.0.4","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.8.0","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.2.1","@types/prettier":"^2.0.0","@types/react":"^16.9.34","@typescript-eslint/eslint-plugin":"^2.31.0","@typescript-eslint/parser":"^2.31.0","auto-changelog":"^1.16.3","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.9.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^26.0.1","np":"^6.2.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.5.0","ts-jest":"^25.5.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.2.0"},"readmeFilename":"README.md","readme":"# 🗂 react-universal-data\n\n[![](https://flat.badgen.net/npm/v/react-universal-data?cache=600)](https://www.npmjs.com/package/react-universal-data) [![](https://flat.badgen.net/bundlephobia/minzip/react-universal-data?cache=600)](https://bundlephobia.com/result?p=react-universal-data) ![](https://flat.badgen.net/travis/exah/react-universal-data?cache=600)\n\n#### Easy to use hook for getting data on client and server side with effortless hydration of state\n\n- [x] Only 600B minified and gziped\n- [x] Simple hooks API\n- [x] TypeScript\n- [x] Can handle updates\n- [x] [Suspense](http://reactjs.org/docs/concurrent-mode-suspense.html) on server side via [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) 💕\n\n> _This is a NO BULLSHIT hook: just PLUG IT in your components, get ALL THE DATA you need (and some more) both CLIENT- and SERVER-side, HYDRATE that ~~bastard~~ app while SSRing like it's NO BIG DEAL, effortlessly PASS IT to the client and render THE SHIT out of it_\n>\n> [@razdvapoka](https://github.com/razdvapoka)\n\n## 📦 Install\n\n```sh\n$ npm i -S react-universal-data\n```\n\n```sh\n$ yarn add react-universal-data\n```\n\n## 📖 Docs\n\n### `useFetchData`\n\nRequests data and preserves the result to the state.\n\n```ts\ntype useFetchData<T> = (\n  // async function that can return any type of data\n  fetcher: (id: string, context: { isServer: boolean }) => Promise<T>,\n  // unique id that will be used for storing & hydrating data while SSR\n  id: string\n) => AsyncState<T>\n```\n\n> ⚠️ The `id` must be unique for the whole application.\n\nReturned object can be in 4 different forms – depending on the promise's state.\n\n```ts\nexport type AsyncState<T> =\n  // initial\n  | { isReady: false; isLoading: false; error: null; result: undefined }\n  // fulfilled\n  | { isReady: true; isLoading: false; error: null; result: T }\n  // pending\n  | { isReady: boolean; isLoading: true; error: Error | null; result?: T }\n  // rejected\n  | { isReady: false; isLoading: false; error: Error; result?: T }\n```\n\n<details><summary>👀 Fetch a sample post via <a href=\"https://jsonplaceholder.typicode.com\">jsonplaceholder.typicode.com</a> API</summary>\n\n```js\nimport React from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nconst fetchPost = (id) =>\n  fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)\n    .then((response) => response.json())\n\nfunction Post({ id }) {\n  const { isReady, isLoading, result, error } = useFetchData(fetchPost, id)\n\n  if (isLoading) {\n    return <p>Loading...</p>\n  }\n\n  if (error) {\n    return <p>Oh no: {error.message}</p>\n  }\n\n  // You can depend on `isReady` flag to ensure data loaded correctly\n  if (isReady) {\n    return (\n      <article>\n        <h2>{result.title}</h2>\n        <p>{result.body}</p>\n      </article>\n    )\n  }\n\n  return null\n}\n```\n</details>\n\nAs the hook depends on the `fetcher` function identity to be stable, please, wrap it inside `useCallback` or define it outside of the render function to prevent infinite updates.\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction UserPosts({ userId }) {\n  const fetchPosts = useCallback(() => (\n    fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n      .then((response) => response.json())\n  ), [userId]) // will pereform update if value changed\n\n  const { result = [] } = useFetchData(fetchPosts, 'user-posts')\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n\n<details><summary>👀 Create a custom hook for it</summary>\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction useFetchUserPosts(userId) {\n  return useFetchData(\n    useCallback(() => (\n      fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n        .then((response) => response.json())\n    ), [userId]),\n    'user-posts'\n  )\n}\n\nfunction UserPosts({ userId }) {\n  const { result = [] } = useFetchUserPosts(userId)\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n</details>\n\n### `getInitialData`\n\nHandles `useFetchData` on server side and gathers results for [hydration](#hydrateInitialData) in the browser.\n\n```ts\ntype getInitialData = (element: JSX.Element) => Promise<[string, any][]>\n```\n\n```js\n// server.js\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nasync function server(req, res) {\n  const element = <App />\n\n  const data = await getInitialData(element).catch((error) => /* handle error */)\n  const html = renderToString(\n    <html>\n      <body>\n        <div id='app'>{element}</div>\n        <script\n          dangerouslySetInnerHTML={{\n            __html: `window._ssr = ${JSON.stringify(data)};`,\n          }}\n        />\n        <script src='/client.js' />\n      </body>\n    </html>\n  )\n\n  res.write('<!DOCTYPE html>')\n  res.write(html)\n  res.end()\n}\n```\n\n### `hydrateInitialData`\n\nHydrates initial data gathered with [`getInitialData`](#getInitialData) before rendering the app in the browser.\n\n```ts\ntype hydrateInitialData = (initial: [string, any][]) => void\n```\n\n```js\n// client.js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nhydrateInitialData(window._ssr || [])\nReactDOM.hydrate(<App />, document.getElementById('app'))\n```\n\n\n## 💻 Demo\n\n[![Edit react-universal-data-ssr](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-universal-data-ssr-jp9el?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=dark)\n\n## 🔗 Related\n\n### Packages\n\n- [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) - server-side dependency\n- [`ya-fetch`](https://github.com/exah/ya-fetch) - a lightweight wrapper around `fetch`\n\n### Real world usages\n\n- [kayway.me](https://github.com/exah/kayway)\n- [goremykina.com](https://github.com/exah/goremykina)\n- [strelkamag.com](https://strelkamag.com)\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.0-3","dist":{"shasum":"4a830ab31b54b7529ab97fac3e92eff51cd87e94","integrity":"sha512-TnrYqhZ6rqSUZfzs3D4bVMKhiDaISLwYjVGuQsdstc4dS6h0gRdcHeAqyHOw7246ZpKjbVLM5nPNO1roFyYk/Q==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.0-3.tgz","fileCount":35,"unpackedSize":36690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetcbWCRA9TVsSAnZWagAAyS0QAIibc9dOKmNNdBu16ZxB\nSVPS9nw9AeSGlw5Mm+FmWelk/CxzkoiO634Ic8ZQ3nvSYFxeP/zUTP95jCTB\n4CtfePdhMxEZErgQrPmiPmRttrzj/AsJYWGcmM08ZJyFdlZBRzJ4Ai71Lqsy\niXLtWUd07jpzvuDViemtsLdcXJxOUT55hM2/pnJt0pmcbH3ewyPGeI0YMzy9\n6VoxsvCc7MI4e8bFsyMyY0H6PlAZj2a9GjdUEO6n0xtFgpFR5qzefuh1T+pP\nivXknjo/1Kh8U+bZAV5EWUYxPRnAJYiyuWfOt6O1kp9o8LikQoe4rHid9SoB\noX6DpP5y6RB2XOgsKLo2WL7iUPNPQGdMOlQyGkqVHdkgNrUNlMMbrJEuPAHb\nnQ74Czco0rDW0OPohYXzEmXWrgro+GfAVQHzrUwcNhQstxhCH5jxL3MJ6BJR\nD5O6KjMssU1zlij05FgbiIbUDyT3uPXVFk37iqfk7W3b30mNrChqjyJcoYqO\ntwkAqM9mPv3QV17K02uhGc1InBtuMQ5aKquPBgqZTfKZB5J07ALzE1PbY4Gq\nxm8aw5sd5RRRMhV8DBIaoWMd7e+hG0ttas000RgYFnBir+EKquiQlVEnH5oU\niqKDXcEWLDrJa4KInfeBi/S5s0SCSTMTBrpP7c1GunaKiAg1DPwcs17/m6AQ\nbt5E\r\n=44fJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCR6z/mDhfkC62yQmCJg6SwqFy1IPtcLxpBhSbr2v9UXwIgcMk/LRpvKBVD3fQVADQMicAv49b9/Y3hWkGqoON7iuI="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.0-3_1588971221911_0.19290444314697264"},"_hasShrinkwrap":false},"4.1.0":{"name":"react-universal-data","version":"4.1.0","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","coverage":"jest --coverage && coveralls < coverage/lcov.info","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.5.0","@testing-library/jest-dom":"^5.7.0","@testing-library/react":"^10.0.4","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.8.0","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.2.1","@types/prettier":"^2.0.0","@types/react":"^16.9.34","@typescript-eslint/eslint-plugin":"^2.31.0","@typescript-eslint/parser":"^2.31.0","auto-changelog":"^1.16.3","coveralls":"^3.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.9.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^26.0.1","np":"^6.2.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.5.0","ts-jest":"^25.5.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.2.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.0","dist":{"shasum":"8df4b8122a08bc0156acd59767748f291ef068de","integrity":"sha512-T7v7GuzigGrJLs8D/uUby/0diiFScID8DmWZHHRVDStA+k6aUFyxmshXJfUCtrPlFagVLKvx185pyBvG+GbcKQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.0.tgz","fileCount":35,"unpackedSize":34842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetyCLCRA9TVsSAnZWagAAq60P/2ydwB+58t8YhdpL02vG\nlzguXQNt5u72NeSmLTS8p4L9vdp5ovWd/9laPp4JdsS6YLlHgkRdI+n1JKFk\n3/HMChlxf/Ri1m9mPPVpJRB10gaOlUgHUICnakQc14rdsAcknPm4a4bxHbMh\nEYZd4d4GadL7OquIIwjpaNk94fPdq2NY1OVbxaeY+Cudro6WZOsbBxJ6ymyc\nTLh1cCe0Yqmh7JdH/49kbzV9WHX0rYhPY/HXY3JlKJlakbqPgcp6fvsQtnuG\npsB+4/PXMDRp4ZBiqSo7UOLFyA91wEJjZhGzODCu2u+1Cgr7Nt2MuC2iCDAR\n/MLkKFmFpv3DvIgnNO0lHG6vSkC+2t5ceeOujbryhbHRl9sk5QoYDAEIkmzV\nh4f7OesAED0BrXIlt5W//T1DfuMCg78GqVwYa7DuIAiDmMyk7Y6QOIGYdaPz\nbGCKlvGnkYwwgDva7tjoMlvbk05yBQCcIl/DyYxqZ6oEYFzNCUbmZdGjopYi\n/KDdEc2622DkQL6cYeL04QaeHtyqw7qqvZ7SLqF2nMC/s8pPiFHwO1WmQTDA\nQJ6rEJvITIGGx8vtxoTNTjrtrr5He4Sewbw4erErqi4wXBwKoar+6FhrP4Fp\nC2Fq3E5KcanA9VXZ+D568SJo2jkdCDz6QWuMUffVXMNEInFe+jX0+71O5gJ2\ni+Z2\r\n=VJMA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0ffmDmnQ52gbRgESBg+xGM078QTOnbnzQ937PwN5SnAIhALPBywMhYJSpheqJn6wWvUv4tpF+7myJGjP7R11d/iUX"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.0_1589059722733_0.594188535233918"},"_hasShrinkwrap":false},"4.1.1":{"name":"react-universal-data","version":"4.1.1","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","coverage":"jest --coverage && coveralls < coverage/lcov.info","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.5.0","@testing-library/jest-dom":"^5.7.0","@testing-library/react":"^10.0.4","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.8.0","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.2.1","@types/prettier":"^2.0.0","@types/react":"^16.9.34","@typescript-eslint/eslint-plugin":"^2.31.0","@typescript-eslint/parser":"^2.31.0","auto-changelog":"^1.16.3","coveralls":"^3.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.9.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^26.0.1","np":"^6.2.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.5.0","ts-jest":"^25.5.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.2.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.1","dist":{"shasum":"2da8b7b3ad7c2ad1f6e234943af496f9d4d7f6cd","integrity":"sha512-RHxWDm8ATatFe8ppBDZFcsWEHfJAnW7hCMc9mCgtkDqFtQzUEGnnhD5huHyR3WP41ypphSPtIsiDdDYXCqSbkQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.1.tgz","fileCount":35,"unpackedSize":35333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetzoBCRA9TVsSAnZWagAA7u0P/Rh+sZTOe5Mbulm7tIHm\ngCAQzDqB+4IE6lismhf5UVeNv/5qybmsdLyjxyI4dx/vNHI66s52UqgaMRp/\n043DmiNqmLhany1+QVnIeDlznPNuwD9VYpA2p1idOMfddU8PJ+9v2ItLRIRt\nf4MVb2UP4TuA+FgVGMOaOAx0zAtLRhwiAnn2Y6aE4uBwDwlIXHh3yi+tWGRZ\nJtzcB/zR91bHKZ8YJrgSqWi4TBIuTcj8YdNOIG/eAAx++3rUuLZfBqoxzMN/\nn/v+JFYZh0ohvfR7tbmDFgGxLqhngxZqMAjs6QnYZMTtfDeyg7sSvBtnEhP/\nNxaDmtHovDGi2VKF1eRGcsuTVhYzLkdNL31niJo0xs1vM3l1SMRHojkX8nsK\nW5hB0qI8yn2SYCaZ6A1lyZ1R6xlB7IqfrkkcAao9mHa7HHkUEWo8jMWc9UF7\n4z9UsPyKDFqO2hemjUg8kc6Io9dRysDrg2dQ1c89gR+zxO2ViypcTga9gTqy\n1yHnZr4gK/7QuExxzbzF+IJnENjIllNtSIwKixEFvauLpS+vLVppaNm6xMlt\nCC8ZbE5d6J6ollZz2SbEm4996DGKBZAy5NnKCJqprc4X9A2b+Fkysrgr3rlI\nbFqkAyP3EZuNSZa/bi7xi4FqDpvxTa+l8rrFMTuygkiKaiBWPqCvGAiDokGJ\nVTAc\r\n=RPnE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9q0gDaotGAQoxYGtF+ZpulQssJ2QMkMdOc/hmNXVHbwIgK3ze+CtQVqsMJqpSrUUuY62b6uCBaiiosYOl4uqGk4k="}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.1_1589066240787_0.8494971885321796"},"_hasShrinkwrap":false},"4.1.2":{"name":"react-universal-data","version":"4.1.2","description":"Easy to use hook for getting data on client and server side with effortless hydration of state","author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"sideEffects":false,"main":"cjs/index.js","module":"esm/index.js","types":"types/index.d.ts","browser":{"./cjs/index.js":"./cjs/index.browser.js","./esm/index.js":"./esm/index.browser.js"},"keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"],"scripts":{"build":"run-s build:*","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build:types":"tsc -p tsconfig.types.json","prebuild":"rimraf esm cjs types","test":"jest","coverage":"jest --coverage && coveralls < coverage/lcov.info","lint":"eslint --ext ts --ext js src/","size":"size-limit","release":"np --no-cleanup","version":"auto-changelog -p && git add CHANGELOG.md","preversion":"npm run build"},"publishConfig":{"access":"public"},"auto-changelog":{"commitLimit":10,"template":".changelog.hbs"},"size-limit":[{"path":"./esm/index.js","limit":"600B"}],"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["standard","standard-react","prettier"],"env":{"jest/globals":true},"plugins":["jest","prettier","@typescript-eslint"],"rules":{"@typescript-eslint/no-unused-vars":2,"@typescript-eslint/no-use-before-define":[2,{"functions":false,"classes":false,"enums":false,"variables":false,"typedefs":false}],"no-unused-vars":0,"no-undef":0,"prettier/prettier":2,"no-shadow":2,"react/prop-types":0,"react/jsx-pascal-case":0}},"jest":{"preset":"ts-jest/presets/js-with-ts"},"peerDependencies":{"react":"^16.8.13","react-dom":"^16.13.0","react-is":"^16.13.0"},"devDependencies":{"@size-limit/preset-small-lib":"^4.5.0","@testing-library/jest-dom":"^5.7.0","@testing-library/react":"^10.0.4","@testing-library/react-hooks":"^3.2.1","@types/eslint":"^6.8.0","@types/eslint-plugin-prettier":"^2.2.0","@types/jest":"^25.2.1","@types/prettier":"^2.0.0","@types/react":"^16.9.34","@typescript-eslint/eslint-plugin":"^2.31.0","@typescript-eslint/parser":"^2.31.0","auto-changelog":"^1.16.3","coveralls":"^3.1.0","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-config-standard":"^14.1.1","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.9.0","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.3","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.19.0","eslint-plugin-standard":"^4.0.1","jest":"^26.0.1","np":"^6.2.3","npm-run-all":"^4.1.5","prettier":"^2.0.5","react":"^16.13.1","react-dom":"^16.13.1","react-is":"^16.13.1","react-test-renderer":"^16.13.1","rimraf":"^3.0.2","size-limit":"^4.5.0","ts-jest":"^25.5.0","typescript":"^3.7.5"},"dependencies":{"react-ssr-prepass":"^1.2.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 John Grishin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"react-universal-data@4.1.2","dist":{"shasum":"bf96bb6194b71e862845c70366d19105fd339bbe","integrity":"sha512-hkRsz0FAnA6aSSD+y40en8USeDHUkByksGZf6E2Hze/A3Jey8ODnceaCyedpdzcT3W9o+c1l8GZyfrizKuBMnQ==","tarball":"https://registry.npmjs.org/react-universal-data/-/react-universal-data-4.1.2.tgz","fileCount":35,"unpackedSize":35787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuBA5CRA9TVsSAnZWagAAnq4P+wa+Hj6PdOPGRtM9B/Au\nV7BYRRbSU7jmj0niMyEQ0OY+Vx6NbLZareMwv9GQ1aKRA5tmC7R3lRY/yL68\nPwe8q4NVonSym+FILJQhhiWb78tNPGTWSkS8iCgvGvS3RnhdqhLhPMc4Qzo6\n+DKFrrNn0yY1/7uo5shJuwGu6BE7aC26b1h/ln4XqAW9qFhTx2bBHUswUBLv\nA0gTOlI81M+i5j2DIFeI3uiHXQ90BjkWtTYswkrfZOa/6clRRNljAzYAJLID\nzdRChMWEwkuCCNK7gHGPRhPr8yK7o/NGcgQeT7Y8ieC+VJ/yrX5bAxwKpebd\n00DRXh5hNpL+13dO5s56Yo2F6nTr0P8W9hQm7W/5jSFtuPN3O0dRN6dRcqkw\nPW3Vc33Hvr6eInqjwn6bkjkTqO5Lq6S4jM07bpIlUilbSEz39k7hqvGwLvkm\nKMbWqkx45a4sJashgqb4kpVhaQ0S96D+LQpqiMeUd1PU1bWBqotzb8MIQfp2\nzHWgW4uyT6WLa3iJh+39L5WKLmvXXPvgJO9V7XBOzaMN2hPcWGWFr/Ekrh4r\nrBeHXMO4cbuuuU2SeVF7v6zFRD9bKnFvj0JXIEJ3cBe8tSnObbzb/qaTyy4c\n7WEGXK6oJ3aldH3ktrXb3nfBp5PNEFI1tIWfqNvkU/vd613Ze+/H60b4nfqz\nMQMQ\r\n=GBUH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDktcE0Fela38uHYSpfuT70sFdgAnqqFJtLzzFW9cVOugIhAL5J0bTnRgSdR4kZAw5B4I0k08wctFfL/3j6rmV2o7+1"}]},"maintainers":[{"name":"exah","email":"r@exah.me"}],"_npmUser":{"name":"exah","email":"r@exah.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-universal-data_4.1.2_1589121080841_0.5541469126555618"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-04T16:59:49.289Z","2.0.0":"2018-07-04T16:59:49.582Z","modified":"2022-06-26T08:48:09.722Z","2.0.1":"2018-07-05T06:11:40.254Z","2.1.0":"2018-07-05T11:40:29.900Z","2.1.1":"2018-07-16T19:18:07.926Z","2.1.2":"2018-07-18T13:24:31.451Z","2.1.3":"2018-07-24T11:29:23.186Z","2.2.0":"2018-09-02T20:19:42.108Z","2.2.1":"2018-09-03T07:34:41.309Z","2.2.2":"2018-09-17T17:24:03.347Z","2.3.0-0":"2018-12-23T10:06:08.792Z","2.3.0":"2018-12-23T16:50:43.977Z","3.0.0-0":"2019-04-29T21:42:23.251Z","3.0.0":"2019-05-01T08:09:32.418Z","3.0.1":"2020-03-01T11:03:51.908Z","4.0.0-0":"2020-03-15T20:36:39.810Z","4.0.0-1":"2020-03-15T20:50:06.636Z","4.0.0-2":"2020-03-15T23:53:35.150Z","4.0.0-3":"2020-03-16T00:04:33.463Z","4.0.0-4":"2020-03-16T00:14:49.139Z","4.0.0-5":"2020-03-22T11:29:58.470Z","4.0.0-6":"2020-03-22T23:17:50.956Z","4.0.0":"2020-03-28T16:37:38.959Z","4.0.1":"2020-03-28T20:08:26.166Z","4.0.2":"2020-04-26T17:52:09.137Z","4.1.0-0":"2020-05-07T11:16:34.809Z","4.1.0-1":"2020-05-08T18:31:47.935Z","4.1.0-2":"2020-05-08T20:42:23.699Z","4.1.0-3":"2020-05-08T20:53:42.017Z","4.1.0":"2020-05-09T21:28:42.856Z","4.1.1":"2020-05-09T23:17:20.914Z","4.1.2":"2020-05-10T14:31:20.935Z"},"maintainers":[{"name":"exah","email":"r@exah.me"}],"description":"Easy to use hook for getting data on client and server side with effortless hydration of state","repository":{"type":"git","url":"https://github.com/exah/react-universal-data.git"},"author":{"name":"John Grishin","email":"hi@johngrish.in"},"license":"MIT","readme":"# 🗂 react-universal-data\n\n[![](https://flat.badgen.net/npm/v/react-universal-data?cache=600)](https://www.npmjs.com/package/react-universal-data) [![](https://flat.badgen.net/bundlephobia/minzip/react-universal-data?cache=600)](https://bundlephobia.com/result?p=react-universal-data) ![](https://flat.badgen.net/travis/exah/react-universal-data?cache=600) ![](https://flat.badgen.net/coveralls/c/github/exah/react-universal-data)\n\n#### Easy to use hook for getting data on client and server side with effortless hydration of state\n\n- [x] Only 600B minified and gziped\n- [x] Simple hooks API\n- [x] TypeScript\n- [x] Can handle updates\n- [x] Simple cache\n- [x] [Suspense](http://reactjs.org/docs/concurrent-mode-suspense.html) on server side via [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) 💕\n\n> _This is a NO BULLSHIT hook: just PLUG IT in your components, get ALL THE DATA you need (and some more) both CLIENT- and SERVER-side, HYDRATE that ~~bastard~~ app while SSRing like it's NO BIG DEAL, effortlessly PASS IT to the client and render THE SHIT out of it_\n>\n> [@razdvapoka](https://github.com/razdvapoka)\n\n## 📦 Install\n\n```sh\n$ npm i -S react-universal-data\n```\n\n```sh\n$ yarn add react-universal-data\n```\n\n## 📖 Docs\n\n### `useFetchData`\n\nRequests data and preserves the result to the state.\n\n```ts\ntype useFetchData<T> = (\n  // async function that can return any type of data\n  fetcher: (key: string, context: { isServer: boolean }) => Promise<T>,\n  // unique key that will be used for storing & hydrating data while SSR\n  key: string,\n  // use cached value for specified duration of time, by default it will be requested each time\n  ttl?: number\n) => AsyncState<T>\n```\n\n> ⚠️ The `key` must be unique for the whole application.\n\nReturned object can be in 4 different forms – depending on the promise's state.\n\n```ts\nexport type AsyncState<T> =\n  // initial\n  | { isReady: false; isLoading: false; error: null; result: undefined }\n  // fulfilled\n  | { isReady: true; isLoading: false; error: null; result: T }\n  // pending\n  | { isReady: boolean; isLoading: true; error: Error | null; result?: T }\n  // rejected\n  | { isReady: false; isLoading: false; error: Error; result?: T }\n```\n\n<details><summary>👀 Fetch a sample post via <a href=\"https://jsonplaceholder.typicode.com\">jsonplaceholder.typicode.com</a> API</summary>\n\n```js\nimport React from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nconst fetchPost = (id) =>\n  fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)\n    .then((response) => response.json())\n\nfunction Post({ id }) {\n  const { isReady, isLoading, result, error } = useFetchData(fetchPost, id)\n\n  if (isLoading) {\n    return <p>Loading...</p>\n  }\n\n  if (error) {\n    return <p>Oh no: {error.message}</p>\n  }\n\n  // You can depend on `isReady` flag to ensure data loaded correctly\n  if (isReady) {\n    return (\n      <article>\n        <h2>{result.title}</h2>\n        <p>{result.body}</p>\n      </article>\n    )\n  }\n\n  return null\n}\n```\n</details>\n\nAs the hook depends on the `fetcher` function identity to be stable, please, wrap it inside `useCallback` or define it outside of the render function to prevent infinite updates.\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction UserPosts({ userId }) {\n  const fetchPosts = useCallback(() => (\n    fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n      .then((response) => response.json())\n  ), [userId]) // will pereform update if value changed\n\n  const { result = [] } = useFetchData(fetchPosts, 'user-posts')\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n\n<details><summary>👀 Create a custom hook for it</summary>\n\n```js\nimport React, { useCallback } from 'react'\nimport { useFetchData } from 'react-universal-data'\n\nfunction useFetchUserPosts(userId) {\n  return useFetchData(\n    useCallback(() => (\n      fetch(`https://jsonplaceholder.typicode.com/posts?userId=${userId}`)\n        .then((response) => response.json())\n    ), [userId]),\n    'user-posts'\n  )\n}\n\nfunction UserPosts({ userId }) {\n  const { result = [] } = useFetchUserPosts(userId)\n\n  return (\n    <ul>\n      {result.map((post) => <li key={post.id}>{post.title}</li>)}\n    </ul>\n  )\n}\n```\n</details>\n\n### `getInitialData`\n\nHandles `useFetchData` on server side and gathers results for [hydration](#hydrateInitialData) in the browser.\n\n```ts\ntype getInitialData = (element: JSX.Element) => Promise<[string, any][]>\n```\n\n```js\n// server.js\nimport React from 'react'\nimport { renderToString } from 'react-dom/server'\nimport { getInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nasync function server(req, res) {\n  const element = <App />\n\n  const data = await getInitialData(element).catch((error) => /* handle error */)\n  const html = renderToString(\n    <html>\n      <body>\n        <div id='app'>{element}</div>\n        <script\n          dangerouslySetInnerHTML={{\n            __html: `window._ssr = ${JSON.stringify(data)};`,\n          }}\n        />\n        <script src='/client.js' />\n      </body>\n    </html>\n  )\n\n  res.write('<!DOCTYPE html>')\n  res.write(html)\n  res.end()\n}\n```\n\n### `hydrateInitialData`\n\nHydrates initial data gathered with [`getInitialData`](#getInitialData) before rendering the app in the browser.\n\n```ts\ntype hydrateInitialData = (initial: [string, any][]) => void\n```\n\n```js\n// client.js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { hydrateInitialData } from 'react-universal-data'\nimport { App } from './App'\n\nhydrateInitialData(window._ssr || [])\nReactDOM.hydrate(<App />, document.getElementById('app'))\n```\n\n\n## 💻 Demo\n\n[![Edit react-universal-data-ssr](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-universal-data-ssr-jp9el?fontsize=14&hidenavigation=1&module=%2Fsrc%2FApp.js&theme=dark)\n\n## 🔗 Related\n\n### Packages\n\n- [`react-ssr-prepass`](https://github.com/FormidableLabs/react-ssr-prepass) - server-side dependency\n- [`ya-fetch`](https://github.com/exah/ya-fetch) - a lightweight wrapper around `fetch`\n\n### Real world usages\n\n- [kayway.me](https://github.com/exah/kayway)\n- [goremykina.com](https://github.com/exah/goremykina)\n- [strelkamag.com](https://strelkamag.com)\n\n---\n\nMIT © [John Grishin](http://johngrish.in)\n","readmeFilename":"README.md","keywords":["react","ssr","data","hook","isomorphic","universal","suspense","prefetch","async","server-rendering"]}