{"_id":"@200kph/swr-firestore","_rev":"4-20f5fb1e55a0572debb2e14498ddcb72","name":"@200kph/swr-firestore","dist-tags":{"latest":"0.16.5"},"versions":{"0.16.1":{"name":"@200kph/swr-firestore","version":"0.16.1","description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint --ext .js,.ts,.tsx .","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example/ios && node -e \"process.exit(require('os').platform() === 'darwin')\" || pod install","bootstrap":"yarn example && yarn"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"license":"MIT","bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"homepage":"https://github.com/alexandersergan/swr-firestore#readme","devDependencies":{"@commitlint/config-conventional":"^17.6.6","@firebase/firestore-types":"^3.0.0","@react-native-community/bob":"^0.17.1","@react-native-community/eslint-config":"^3.2.0","@release-it/conventional-changelog":"^7.0.0","@types/jest":"^29.5.3","@types/lodash.get":"^4.4.7","@types/lodash.set":"^4.3.7","@types/react":"^18.2.14","@types/react-native":"0.72.2","commitlint":"^17.6.6","eslint":"^8.44.0","eslint-config-nando":"^1.1.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","firebase":"^10.0.0","jest":"^29.6.1","prettier":"^3.0.0","react":"~18.2.0","react-native":"~0.72.2","release-it":"^16.1.0","typescript":"^5.1.6"},"peerDependencies":{"react":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn lint && yarn typescript"}},"eslintIgnore":["node_modules/","lib/"],"release-it":{"git":{"commitMessage":"chore: release %s","tagName":"v%s"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"dependencies":{"lodash.get":"^4.4.2","lodash.set":"^4.3.2","swr":"^2.2.0"},"gitHead":"e52763451f0e5021bb7b44d3e55773bdc603cb91","_id":"@200kph/swr-firestore@0.16.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-gwYP3OfO/xi35c9yDGqjqcrVBFkJDHsHq1V27EeOGnEVmg312GsGjQmHcL+UtJ/oPo7drjrdsaFeEPFIOMYPRw==","shasum":"f14e8978ed566102450034636469f393078694c9","tarball":"https://registry.npmjs.org/@200kph/swr-firestore/-/swr-firestore-0.16.1.tgz","fileCount":89,"unpackedSize":337664,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1/RPEH2T+uaetnOxIOj1r3eiF6XCNbkLsAEPVLaJBSAiEA2ldQzxrhXRuE6VJr6bELFUi4MFDpXuPdbl9apzHUZjo="}]},"_npmUser":{"name":"koreshokveterok","email":"veteroque@gmail.com"},"directories":{},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swr-firestore_0.16.1_1689174534251_0.39074064297065103"},"_hasShrinkwrap":false},"0.16.2":{"name":"@200kph/swr-firestore","version":"0.16.2","description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint --ext .js,.ts,.tsx .","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example/ios && node -e \"process.exit(require('os').platform() === 'darwin')\" || pod install","bootstrap":"yarn example && yarn"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"license":"MIT","bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"homepage":"https://github.com/alexandersergan/swr-firestore#readme","devDependencies":{"@commitlint/config-conventional":"^17.6.6","@react-native-community/bob":"^0.17.1","@react-native-community/eslint-config":"^3.2.0","@release-it/conventional-changelog":"^7.0.0","@types/jest":"^29.5.3","@types/lodash.get":"^4.4.7","@types/lodash.set":"^4.3.7","@types/react":"^18.2.14","@types/react-native":"0.72.2","commitlint":"^17.6.6","eslint":"^8.44.0","eslint-config-nando":"^1.1.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","firebase":"^10.0.0","jest":"^29.6.1","prettier":"^3.0.0","react":"~18.2.0","react-native":"~0.72.2","release-it":"^16.1.0","typescript":"^5.1.6"},"peerDependencies":{"react":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn lint && yarn typescript"}},"eslintIgnore":["node_modules/","lib/"],"release-it":{"git":{"commitMessage":"chore: release %s","tagName":"v%s"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"dependencies":{"lodash.get":"^4.4.2","lodash.set":"^4.3.2","swr":"^2.2.0"},"gitHead":"433b65399da49ef80a8d74916b523aeaea3b0554","_id":"@200kph/swr-firestore@0.16.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-GD2IGqK9DreJWk1uD78Dm4Gskmhz/TwEOfGiVigdu7FH7TauDsdzU2Sa8alsXPgB+7XN35Ri/pJJhsI2K+O0Yg==","shasum":"e563c8d1761cddcbb2932fa781a6f64cf87d49e4","tarball":"https://registry.npmjs.org/@200kph/swr-firestore/-/swr-firestore-0.16.2.tgz","fileCount":89,"unpackedSize":338968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvXJA3xhC+ZausYH9qsCpRCTSOrf/bo+OQ6enRT/sbRAiEA6LgSKbUjQDpv2ytTaHWC+5n30rTkJcz3K46EokaDqxE="}]},"_npmUser":{"name":"koreshokveterok","email":"veteroque@gmail.com"},"directories":{},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swr-firestore_0.16.2_1689177710118_0.6364527100136834"},"_hasShrinkwrap":false},"0.16.3":{"name":"@200kph/swr-firestore","version":"0.16.3","description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint --ext .js,.ts,.tsx .","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example/ios && node -e \"process.exit(require('os').platform() === 'darwin')\" || pod install","bootstrap":"yarn example && yarn"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"license":"MIT","bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"homepage":"https://github.com/alexandersergan/swr-firestore#readme","devDependencies":{"@commitlint/config-conventional":"^17.6.6","@react-native-community/bob":"^0.17.1","@react-native-community/eslint-config":"^3.2.0","@release-it/conventional-changelog":"^7.0.0","@types/jest":"^29.5.3","@types/lodash.get":"^4.4.7","@types/lodash.set":"^4.3.7","@types/react":"^18.2.14","@types/react-native":"0.72.2","commitlint":"^17.6.6","eslint":"^8.44.0","eslint-config-nando":"^1.1.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","firebase":"^10.0.0","jest":"^29.6.1","prettier":"^3.0.0","react":"~18.2.0","react-native":"~0.72.2","release-it":"^16.1.0","typescript":"^5.1.6"},"peerDependencies":{"react":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn lint && yarn typescript"}},"eslintIgnore":["node_modules/","lib/"],"release-it":{"git":{"commitMessage":"chore: release %s","tagName":"v%s"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"dependencies":{"lodash.get":"^4.4.2","lodash.set":"^4.3.2","swr":"^2.2.0"},"gitHead":"1f1908cfd1037bdebd82e070fd658578a68d4bdc","_id":"@200kph/swr-firestore@0.16.3","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-yibAgqo/8f6cvzV5I5z/+PlmPwTTh2rcMo/1xUvOITg1B2yZZcMVbD94zEtehoN+UtroklaUTHXCXhW6SBL3sA==","shasum":"65c801b0bdffb9e4b11d5090fce4476125642f82","tarball":"https://registry.npmjs.org/@200kph/swr-firestore/-/swr-firestore-0.16.3.tgz","fileCount":89,"unpackedSize":339989,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/3LKFTKV3c+XN4/yJnIT/e4Exp1996PSqm8I6WIwuOAiBhYLv+/6c5X9NBiqCF3LddDC22BYWllr3yCGPyWx9iSw=="}]},"_npmUser":{"name":"koreshokveterok","email":"veteroque@gmail.com"},"directories":{},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swr-firestore_0.16.3_1689180670027_0.012964211459152164"},"_hasShrinkwrap":false},"0.16.4":{"name":"@200kph/swr-firestore","version":"0.16.4","description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint --ext .js,.ts,.tsx .","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example/ios && node -e \"process.exit(require('os').platform() === 'darwin')\" || pod install","bootstrap":"yarn example && yarn"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"license":"MIT","bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"homepage":"https://github.com/alexandersergan/swr-firestore#readme","devDependencies":{"@commitlint/config-conventional":"^17.6.6","@react-native-community/bob":"^0.17.1","@react-native-community/eslint-config":"^3.2.0","@release-it/conventional-changelog":"^7.0.0","@types/jest":"^29.5.3","@types/lodash.get":"^4.4.7","@types/lodash.set":"^4.3.7","@types/react":"^18.2.14","@types/react-native":"0.72.2","commitlint":"^17.6.6","eslint":"^8.44.0","eslint-config-nando":"^1.1.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","firebase":"^10.0.0","jest":"^29.6.1","prettier":"^3.0.0","react":"~18.2.0","react-native":"~0.72.2","release-it":"^16.1.0","typescript":"^5.1.6"},"peerDependencies":{"react":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn lint && yarn typescript"}},"eslintIgnore":["node_modules/","lib/"],"release-it":{"git":{"commitMessage":"chore: release %s","tagName":"v%s"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"dependencies":{"lodash.get":"^4.4.2","lodash.set":"^4.3.2","swr":"^2.2.0"},"gitHead":"a73b64124698588c310959370e20554e0e1e6a22","_id":"@200kph/swr-firestore@0.16.4","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-moSM1WSvekEmiBOsF6jHBuXL8VldinWWKiEtoFMwXsIGni/C9wjn5YPNpSUNj0UVMoeBn+ogV6zVaZP6Pj98Rg==","shasum":"7fd8c4fc425de30df3e7447fa0340b00548f6643","tarball":"https://registry.npmjs.org/@200kph/swr-firestore/-/swr-firestore-0.16.4.tgz","fileCount":89,"unpackedSize":341088,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGS38Kk4O5cxBULCtJMQf8OIRRgAsT4nJn6nclXEm1IVAiArTHnczrsOxjmCy26+804tXDMLGjLtnR8EwuORS8hdJg=="}]},"_npmUser":{"name":"koreshokveterok","email":"veteroque@gmail.com"},"directories":{},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swr-firestore_0.16.4_1689181405291_0.8269348924783193"},"_hasShrinkwrap":false},"0.16.5":{"name":"@200kph/swr-firestore","version":"0.16.5","description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint --ext .js,.ts,.tsx .","prepare":"bob build","release":"release-it","example":"yarn --cwd example","pods":"cd example/ios && node -e \"process.exit(require('os').platform() === 'darwin')\" || pod install","bootstrap":"yarn example && yarn"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"license":"MIT","bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"homepage":"https://github.com/alexandersergan/swr-firestore#readme","devDependencies":{"@commitlint/config-conventional":"^17.6.6","@react-native-community/bob":"^0.17.1","@react-native-community/eslint-config":"^3.2.0","@release-it/conventional-changelog":"^7.0.0","@types/jest":"^29.5.3","@types/lodash.get":"^4.4.7","@types/lodash.set":"^4.3.7","@types/react":"^18.2.14","@types/react-native":"0.72.2","commitlint":"^17.6.6","eslint":"^8.44.0","eslint-config-nando":"^1.1.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","firebase":"^10.0.0","jest":"^29.6.1","prettier":"^3.0.0","react":"~18.2.0","react-native":"~0.72.2","release-it":"^16.1.0","typescript":"^5.1.6"},"peerDependencies":{"react":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn lint && yarn typescript"}},"eslintIgnore":["node_modules/","lib/"],"release-it":{"git":{"commitMessage":"chore: release %s","tagName":"v%s"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"@react-native-community/bob":{"source":"src","output":"lib","targets":["commonjs","module","typescript"]},"dependencies":{"lodash.get":"^4.4.2","lodash.set":"^4.3.2","swr":"^2.2.0"},"gitHead":"1ce43317dcba769f5532fb91e74d0710633bb834","_id":"@200kph/swr-firestore@0.16.5","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-IBcDr7ni+jYIRl+kf1x60RzHL8nCsjTSHKgcJ7ZlzjvHHdxcIx7/Aa0Upif27pAlZE2eLsmRHtvjeBwgB8R6Sg==","shasum":"56fbed7a7c01d2880d99cb4749c7f82c73cb46c7","tarball":"https://registry.npmjs.org/@200kph/swr-firestore/-/swr-firestore-0.16.5.tgz","fileCount":89,"unpackedSize":341948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB+99nSwFpmqbEME0Lv9bhA3Bm/kx3VDDGk6uyQYU78+AiEA6C4fZQ0zLSjyh3bacqKzZbGNMgXqD3ikR4bc8OW5g78="}]},"_npmUser":{"name":"koreshokveterok","email":"veteroque@gmail.com"},"directories":{},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/swr-firestore_0.16.5_1689199442315_0.6103035912649042"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-12T15:08:54.128Z","0.16.1":"2023-07-12T15:08:54.456Z","modified":"2023-07-12T22:04:02.705Z","0.16.2":"2023-07-12T16:01:50.423Z","0.16.3":"2023-07-12T16:51:10.234Z","0.16.4":"2023-07-12T17:03:25.532Z","0.16.5":"2023-07-12T22:04:02.518Z"},"maintainers":[{"name":"koreshokveterok","email":"veteroque@gmail.com"}],"description":"SWR React hooks for Firestore, that you can actually use in production, on every screen.","homepage":"https://github.com/alexandersergan/swr-firestore#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alexandersergan/swr-firestore.git"},"author":{"name":"Alexander Sergan","email":"veteroque@gmail.com","url":"https://github.com/alexandersergan"},"bugs":{"url":"https://github.com/alexandersergan/swr-firestore/issues"},"license":"MIT","readme":"# SWR + Firestore\n\n```js\nconst { data } = useDocument('users/fernando')\n```\n\n**It's that easy.**\n\n🔥 This library provides the hooks you need for querying Firestore, that you can actually use in production, on every screen.\n\n⚡️ It aims to be **the fastest way to use Firestore in a React app,** both from a developer experience and app performance perspective.\n\n🍕 This library is built on top [useSWR](https://swr.now.sh), meaning you get all of its awesome benefits out-of-the-box.\n\nYou can now fetch, add, and mutate Firestore data with zero boilerplate.\n\n## Features\n\n- Shared state / cache between collection and document queries [(instead of Redux??)](#shared-global-state-between-documents-and-collections)\n- Works with both **React** and **React Native**.\n- Offline mode with Expo [(without detaching!)](https://github.com/nandorojo/expo-firestore-offline-persistence/blob/master/README.md#usage-with-nandorojoswr-firestore)\n- Blazing fast\n- Query collection groups (**new** in `0.14.x`!)\n- `set`, `update`, and `add` update your global cache, instantly\n- TypeScript-ready [(see docs)](#typescript-support)\n- Realtime subscriptions [(example)](#simple-examples)\n- Prevent memory leaks from Firestore subscriptions\n- No more parsing `document.data()` from Firestore requests\n- Server-side rendering (SSR or SSG) with Next.js [(example)](https://github.com/nandorojo/swr-firestore/issues/17)\n- Automatic date parsing (no more `.toDate()`)\n- Firebase v8 support (see [#59](https://github.com/nandorojo/swr-firestore/issues/59#issuecomment-719950071))\n\n...along with the features touted by Vercel's incredible [SWR](https://github.com/zeit/swr#introduction) library:\n\n_\"With SWR, components will get a stream of data updates constantly and automatically. Thus, the **UI will be always fast and reactive**.\"_\n\n- Transport and protocol agnostic data fetching\n- Fast page navigation\n- Revalidation on focus\n- Interval polling\n- Request deduplication\n- Local mutation\n- Pagination\n- TypeScript ready\n- SSR support\n- Suspense mode\n- Minimal API\n\n## ⭐️\n\nIf you like this library, give it star and let me know on [Twitter](https://twitter.com/fernandotherojo)!\n\n## Installation\n\n```sh\nyarn add @nandorojo/swr-firestore\n\n# or\nnpm install @nandorojo/swr-firestore\n```\n\nInstall firebase:\n\n```sh\n# if you're using expo:\nexpo install firebase\n\n# if you aren't using expo:\nyarn add firebase\n# or\nnpm i firebase\n```\n\n## Set up\n\nIn the root of your app, **create an instance of Fuego** and pass it to the **FuegoProvider**.\n\nIf you're using Firebase v8, see [this solution](https://github.com/nandorojo/swr-firestore/issues/59#issuecomment-719950071) for creating your instance of `Fuego`.\n\nIf you're using `next.js`, this goes in your `pages/_app.js` file.\n\n`App.js`\n\n```jsx\nimport React from 'react'\nimport 'firebase/firestore'\nimport 'firebase/auth'\nimport { Fuego, FuegoProvider } from '@nandorojo/swr-firestore'\n\nconst firebaseConfig = {\n  // put yours here\n}\n\nconst fuego = new Fuego(firebaseConfig)\n\nexport default function App() {\n  return (\n    <FuegoProvider fuego={fuego}>\n      <YourAppHere />\n    </FuegoProvider>\n  )\n}\n```\n\nMake sure to create your `Fuego` instance outside of the component. The only argument `Fuego` takes is your firebase `config` variable.\n\nUnder the hood, this step initializes firebase for you. No need to call `firebase.initializeApp`.\n\n## Basic Usage\n\n_Assuming you've already completed the setup..._\n\n### Subscribe to a document\n\n```js\nimport React from 'react'\nimport { useDocument } from '@nandorojo/swr-firestore'\nimport { Text } from 'react-native'\n\nexport default function User() {\n  const user = { id: 'Fernando' }\n  const { data, update, error } = useDocument(`users/${user.id}`, {\n    listen: true,\n  })\n\n  if (error) return <Text>Error!</Text>\n  if (!data) return <Text>Loading...</Text>\n\n  return <Text>Name: {data.name}</Text>\n}\n```\n\n### Get a collection\n\n```js\nimport React from 'react'\nimport { useCollection } from '@nandorojo/swr-firestore'\nimport { Text } from 'react-native'\n\nexport default function UserList() {\n  const { data, update, error } = useCollection(`users`)\n\n  if (error) return <Text>Error!</Text>\n  if (!data) return <Text>Loading...</Text>\n\n  return data.map(user => <Text key={user.id}>{user.name}</Text>)\n}\n```\n\n`useDocument` accepts a document `path` as its first argument here. `useCollection` works similarly.\n\n## Simple examples\n\n### Query a users collection:\n\n```typescript\nconst { data } = useCollection('users')\n```\n\n### Subscribe for real-time updates:\n\n```typescript\nconst { data } = useDocument(`users/${user.id}`, { listen: true })\n```\n\n### Make a complex collection query:\n\n```typescript\nconst { data } = useCollection('users', {\n  where: ['name', '==', 'fernando'],\n  limit: 10,\n  orderBy: ['age', 'desc'],\n  listen: true,\n})\n```\n\n### Pass options from SWR to your document query:\n\n```typescript\n// pass SWR options\nconst { data } = useDocument('albums/nothing-was-the-same', {\n  shouldRetryOnError: false,\n  onSuccess: console.log,\n  loadingTimeout: 2000,\n})\n```\n\n### Pass options from SWR to your collection query:\n\n```typescript\n// pass SWR options\nconst { data } = useCollection(\n  'albums',\n  {\n    listen: true,\n    // you can pass multiple where conditions if you want\n    where: [\n      ['artist', '==', 'Drake'],\n      ['year', '==', '2020'],\n    ],\n  },\n  {\n    shouldRetryOnError: false,\n    onSuccess: console.log,\n    loadingTimeout: 2000,\n  }\n)\n```\n\n### Add data to your collection:\n\n```typescript\nconst { data, add } = useCollection('albums', {\n  where: ['artist', '==', 'Drake'],\n})\n\nconst onPress = async () => {\n  // calling this will automatically update your global cache & Firestore\n  const documentId = await add({\n    title: 'Dark Lane Demo Tapes',\n    artist: 'Drake',\n    year: '2020',\n  })\n}\n```\n\n### Set document data:\n\n```typescript\nconst { data, set, update } = useDocument('albums/dark-lane-demo-tapes')\n\nconst onReleaseAlbum = () => {\n  // calling this will automatically update your global cache & Firestore\n  set(\n    {\n      released: true,\n    },\n    { merge: true }\n  )\n\n  // or you could call this:\n  update({\n    released: true,\n  })\n}\n```\n\n### Use dynamic fields in a request:\n\nIf you pass `null` as the collection or document key, the request won't send.\n\nOnce the key is set to a string, the request will send.\n\n**Get list of users who have you in their friends list**\n\n```typescript\nimport { useDoormanUser } from 'react-doorman'\n\nconst { uid } = useDoormanUser()\nconst { data } = useCollection(uid ? 'users' : null, {\n  where: ['friends', 'array-contains', uid],\n})\n```\n\n**Get your favorite song**\n\n```typescript\nconst me = { id: 'fernando' }\n\nconst { data: user } = useDocument<{ favoriteSong: string }>(`users/${me.id}`)\n\n// only send the request once the user.favoriteSong exists!\nconst { data: song } = useDocument(\n  user?.favoriteSong ? `songs/${user.favoriteSong}` : null\n)\n```\n\n### Parse date fields in your documents\n\nMagically turn any Firestore timestamps into JS date objects! No more `.toDate()`.\n\nImagine your `user` document schema looks like this:\n\n```typescript\ntype User = {\n  name: string\n  lastUpdated: {\n    date: Date\n  }\n  createdAt: Date\n}\n```\n\nIn order to turn `createdAt` and `lastUpdated.date` into JS objects, just use the `parseDates` field:\n\n**In a document query**\n\n```typescript\nconst { data } = useDocument<User>('user/fernando', {\n  parseDates: ['createdAt', 'lastUpdated.date'],\n})\n\nlet createdAt: Date\nif (data) {\n  // ✅ all good! it's a JS Date now.\n  createdAt = data.createdAt\n}\n```\n\n`data.createdAt` and `data.lastUpdated.date` are both JS dates now!\n\n**In a collection query**\n\n```typescript\nconst { data } = useCollection<User>('user', {\n  parseDates: ['createdAt', 'lastUpdated.date'],\n})\n\nif (data) {\n  data.forEach(document => {\n    document.createdAt // JS date!\n  })\n}\n```\n\nFor more explanation on the dates, see [issue #4](https://github.com/nandorojo/swr-firestore/issues/4).\n\n### Access a document's Firestore snapshot\n\nIf you set `ignoreFirestoreDocumentSnapshotField` to `false`, you can access the `__snapshot` field.\n\n```js\nconst { data } = useDocument('users/fernando', {\n  ignoreFirestoreDocumentSnapshotField: false, // default: true\n})\n\nif (data) {\n  const id = data?.__snapshot.id\n}\n```\n\nYou can do the same for `useCollection` and `useCollectionGroup`. The snapshot will be on each item in the `data` array.\n\nThis comes in handy when you are working with forms for data edits:\n\n**With Formik**\n```js\nconst { data, set } = useDocument('users/fernando', {\n  ignoreFirestoreDocumentSnapshotField: false,\n})\n\nif (!data) return <Loading />\n\n<Formik\n  initialValues={data.__snapshot.data()}\n  ...\n/>\n```\n\n**With state and hooks**\n```js\nconst { data, set } = useDocument('users/fernando', {\n  ignoreFirestoreDocumentSnapshotField: false,\n})\n\nconst [values, setValues] = useState(null);\n\nuseEffect(() => {\n  if (data) {\n    setValues(data.__snapshot.data());\n  }\n}, [data]);\n```\n\n### Paginate a collection:\n\nVideo [here](https://imgur.com/a/o9AlI4N).\n\n```typescript\nimport React from 'react'\nimport { fuego, useCollection } from '@nandorojo/swr-firestore'\n\nconst collection = 'dump'\nconst limit = 1\nconst orderBy = 'text'\n\nexport default function Paginate() {\n  const { data, mutate } = useCollection<{ text: string }>(\n    collection,\n    {\n      limit,\n      orderBy,\n      // 🚨 this is required to get access to the snapshot!\n      ignoreFirestoreDocumentSnapshotField: false,\n    },\n    {\n      // this lets us update the local cache + paginate without interruptions\n      revalidateOnFocus: false,\n      refreshWhenHidden: false,\n      refreshWhenOffline: false,\n      refreshInterval: 0,\n    }\n  )\n\n  const paginate = async () => {\n    if (!data?.length) return\n\n    const ref = fuego.db.collection(collection)\n\n    // get the snapshot of last document we have right now in our query\n    const startAfterDocument = data[data.length - 1].__snapshot\n\n    // get more documents, after the most recent one we have\n    const moreDocs = await ref\n      .orderBy(orderBy)\n      .startAfter(startAfterDocument)\n      .limit(limit)\n      .get()\n      .then(d => {\n        const docs = []\n        d.docs.forEach(doc => docs.push({ ...doc.data(), id: doc.id, __snapshot: doc }))\n        return docs\n      })\n\n    // mutate our local cache, adding the docs we just added\n    // set revalidate to false to prevent SWR from revalidating on its own\n    mutate(state => [...state, ...moreDocs], false)\n  }\n\n  return data ? (\n    <div>\n      {data.map(({ id, text }) => (\n        <div key={id}>{text}</div>\n      ))}\n      <button onClick={paginate}>paginate</button>\n    </div>\n  ) : (\n    <div>Loading...</div>\n  )\n}\n```\n\n## Query Documents\n\nYou'll rely on `useDocument` to query documents.\n\n```js\nimport React from 'react'\nimport { useDocument } from '@nandorojo/swr-firestore'\n\nconst user = { id: 'Fernando' }\nexport default () => {\n  const { data, error } = useDocument(`users/${user.id}`)\n}\n```\n\nIf you want to set up a listener (or, in Firestore-speak, `onSnapshot`) just set `listen` to `true`.\n\n```js\nconst { data, error } = useDocument(`users/${user.id}`, { listen: true })\n```\n\n# API\n\n## Imports\n\n```typescript\nimport {\n  useDocument,\n  useCollection,\n  useCollectionGroup, // 👋 new!\n  revalidateDocument,\n  revalidateCollection,\n  // these all update BOTH Firestore & the local cache ⚡️\n  set, // set a firestore document\n  update, // update a firestore document\n  fuego, // get the firebase instance used by this lib\n  getCollection, // prefetch a collection, without being hooked into SWR or React\n  getDocument, // prefetch a document, without being hooked into SWR or React\n} from '@nandorojo/swr-firestore'\n```\n\n## `useDocument(path, options)`\n\n```js\nconst {\n  data,\n  set,\n  update,\n  deleteDocument,\n  error,\n  isValidating,\n  mutate,\n  unsubscribe\n} = useDocument(path, options)\n```\n\n### Arguments\n\n- **`path` required** The unique document path for your Firestore document.\n  - `string` | `null`. If `null`, the request will not be sent. This is useful if you want to get a user document, but the user ID hasn't loaded yet, for instance.\n  - This follows the same pattern as the `key` argument in `useSWR`. See the [SWR docs](https://github.com/zeit/swr#conditional-fetching) for more. Functions are not currently supported for this argument.\n- `options` _(optional)_ A dictionary with added options for the query. Takes the folowing values:\n  - `listen = false`: If `true`, sets up a listener for this document that updates whenever it changes.\n  - You can also pass any of the [options available from `useSWR`](https://github.com/zeit/swr#options).\n  - `ignoreFirestoreDocumentSnapshotField = true`. See elaboration below.\n  - `parseDates`: An array of string keys that correspond to dates in your document. [Example](#parse-date-fields-in-your-documents).\n\n##### `ignoreFirestoreDocumentSnapshotField`\n\nIf `true`, docs returned in `data` will not include the firestore `__snapshot` field. If `false`, it will include a `__snapshot` field. This lets you access the document snapshot, but makes the document not JSON serializable.\n\nBy default, it ignores the `__snapshot` field. This makes it easier for newcomers to use `JSON.stringify` without weird errors. You must explicitly set it to `false` to use it.\n\n```js\n// include the firestore document snapshots\nconst { data } = useDocument('users/fernando', {\n  ignoreFirestoreDocumentSnapshotField: false,\n})\n\nif (data) {\n  const path = data.__snapshot.ref.path\n}\n```\n\nThe `__snapshot` field is the exact snapshot returned by Firestore.\n\nSee Firestore's [snapshot docs](https://firebase.google.com/docs/reference/js/firebase.firestore.QuerySnapshot) for more.\n\n### Return values\n\nReturns a dictionary with the following values:\n\n- `set(data, SetOptions?)`: Extends the `firestore` document `set` function.\n  - You can call this when you want to edit your document.\n  - It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular Firestore `set` function.\n  - The second argument is the same as the second argument for [Firestore `set`](https://firebase.google.com/docs/firestore/manage-data/add-data#set_a_document).\n- `update(data)`: Extends the Firestore document [`update` function](https://firebase.google.com/docs/firestore/manage-data/add-data#update-data).\n  - It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular `set` function.\n- `deleteDocument()`: Extends the Firestore document [`delete` function](https://firebase.google.com/docs/firestore/manage-data/delete-data).\n  - It also updates the local cache using SWR's `mutate` by deleting your document from this query and all collection queries that have fetched this document. This will prove highly convenient over the regular `delete` function from Firestore.\n- `unsubscribe()` A function that, when called, unsubscribes the Firestore listener.\n  - The function can be null, so make sure to check that it exists before calling it.\n  - **Note**: This is not necessary to use. `useDocument` already unmounts the listener for you. This is only intended if you want to unsubscribe on your own.\n\nThe dictionary also includes the following [from `useSWR`](https://github.com/zeit/swr#return-values):\n\n- `data`: data for the given key resolved by fetcher (or undefined if not loaded)\n- `error`: error thrown by fetcher (or undefined)\n- `isValidating`: if there's a request or revalidation loading\n- `mutate(data?, shouldRevalidate?)`: function to mutate the cached data\n\n## `useCollection(path, query, options)`\n\n```js\nconst { data, add, error, isValidating, mutate, unsubscribe } = useCollection(\n  path,\n  query,\n  options\n)\n```\n\n### Arguments\n\n- **`path`** required string, path to collection.\n- `query` optional dictionary with Firestore query details\n- `options` SWR options [(see SWR docs)](https://github.com/zeit/swr#options)\n\n#### `path`\n\n**`path` required** The unique document path for your Firestore document.\n\n- `string` | `null`. If `null`, the request will not be sent. This is useful if you want to get a user document, but the user ID hasn't loaded yet, for instance.\n- This follows the same pattern as the `key` argument in `useSWR`. See the [SWR docs](https://github.com/zeit/swr#conditional-fetching) for more. Functions are not currently supported for this argument.\n\n#### `query`\n\n_(optional)_ Dictionary that accepts any of the following optional values:\n\n- `listen = false`: if true, will set up a real-time listener that automatically updates.\n- `limit`: number that limits the number of documents\n- [`where`](#where): filter documents by certain conditions based on their fields\n- [`orderBy`](#orderBy): sort documents by their fields\n- `startAt`: number to start at\n- `endAt`: number to end at\n- `startAfter`: number to start after\n- `endBefore`: number to end before\n- `ignoreFirestoreDocumentSnapshotField = true`: If `true`, docs returned in `data` will not include the firestore `__snapshot` field. If `false`, it will include a `__snapshot` field. This lets you access the document snapshot, but makes the document not JSON serializable.\n\n##### `where`\n\nCan be an array, or an array of arrays.\n\nEach array follows this outline: `['key', 'comparison-operator', 'value']`. This is pulled directly from Firestore's [where pattern](https://firebase.google.com/docs/firestore/query-data/queries#query_operators).\n\n```js\n// get all users whose names are Fernando\nuseCollection('users', {\n  where: ['name', '==', 'Fernando'],\n})\n\n// get all users whose names are Fernando & who are hungry\nuseCollection('users', {\n  where: [\n    ['name', '==', 'Fernando'],\n    ['isHungry', '==', true],\n  ],\n})\n\n// get all users whose friends array contains Fernando\nuseCollection('users', {\n  where: ['friends', 'array-contains', 'Fernando'],\n})\n```\n\n##### `orderBy`\n\nCan be a string, array, or an array of arrays.\n\nEach array follows this outline: `['key', 'desc' | 'asc']`. This is pulled directly from Firestore's [orderBy pattern](https://firebase.google.com/docs/firestore/query-data/order-limit-data).\n\n```js\n// get users, ordered by name\nuseCollection('users', {\n  orderBy: 'name',\n})\n\n// get users, ordered by name in descending order\nuseCollection('users', {\n  orderBy: ['name', 'desc'],\n})\n\n// get users, ordered by name in descending order & hunger in ascending order\nuseCollection('users', {\n  orderBy: [\n    ['name', 'desc'], //\n    ['isHungry', 'asc'],\n  ],\n})\n```\n\n##### `ignoreFirestoreDocumentSnapshotField`\n\nIf `true`, docs returned in `data` will not include the firestore `__snapshot` field. If `false`, it will include a `__snapshot` field. This lets you access the document snapshot, but makes the document not JSON serializable.\n\nBy default, it ignores the `__snapshot` field. This makes it easier for newcomers to use `JSON.stringify` without weird errors. You must explicitly set it to `false` to use it.\n\n```js\n// include the firestore document snapshots\nconst { data } = useCollection('users', {\n  ignoreFirestoreDocumentSnapshotField: false,\n})\n\nif (data) {\n  data.forEach(document => {\n    const path = document?.__snapshot.ref.path\n  })\n}\n```\n\nThe `__snapshot` field is the exact snapshot returned by Firestore.\n\nSee Firestore's [snapshot docs](https://firebase.google.com/docs/reference/js/firebase.firestore.QuerySnapshot) for more.\n\n#### `options`\n\n_(optional)_ A dictionary with added options for the request. See the [options available from SWR](https://github.com/zeit/swr#options).\n\n### Return values\n\nReturns a dictionary with the following values:\n\n- `add(data)`: Extends the Firestore document [`add` function](https://firebase.google.com/docs/firestore/manage-data/add-data). Returns the added document ID(s).\n  - It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular `add` function provided by Firestore.\n\nThe returned dictionary also includes the following [from `useSWR`](https://github.com/zeit/swr#return-values):\n\n- `data`: data for the given key resolved by fetcher (or undefined if not loaded)\n- `error`: error thrown by fetcher (or undefined)\n- `isValidating`: if there's a request or revalidation loading\n- `mutate(data?, shouldRevalidate?)`: function to mutate the cached data\n- `unsubscribe()` A function that, when called, unsubscribes the Firestore listener.\n  - The function can be null, so make sure to check that it exists before calling it.\n  - **Note**: This is not necessary to use. `useCollection` already unmounts the listener for you. This is only intended if you want to unsubscribe on your own.\n\n## `useCollectionGroup(path, query, options)`\n\nFollows an identical API as `useCollection`, except that it leverages Firestore's collection group query for merging subcollections with the same name.\n\nTo see how to use it, follow the instructions from [`useCollection`](#useCollection).\n\nSee the Firestore [docs on collecttion groups](https://firebase.google.com/docs/firestore/query-data/queries) to learn more.\n\n## `set(path, data, SetOptions?)`\n\nExtends the `firestore` document `set` function.\n\n- You can call this when you want to edit your document.\n- It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular Firestore `set` function.\n- The second argument is the same as the second argument for [Firestore `set`](https://firebase.google.com/docs/firestore/manage-data/add-data#set_a_document).\n\nThis is useful if you want to `set` a document in a component that isn't connected to the `useDocument` hook.\n\n## `update(path, data)`:\n\nExtends the Firestore document [`update` function](https://firebase.google.com/docs/firestore/manage-data/add-data#update-data).\n\n- It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular `set` function.\n\nThis is useful if you want to `update` a document in a component that isn't connected to the `useDocument` hook.\n\n<!--\n## `add(path, data)`:\n\nExtends the Firestore document [`add` function](https://firebase.google.com/docs/firestore/manage-data/add-data).\n\n- It also updates the local cache using SWR's `mutate`. This will prove highly convenient over the regular `add` function.\n- Use this **instead** of `firebase.firestore().collection('users').add(data)`\n-->\n\n## `deleteDocument(path, ignoreLocalMutations = false)`\n\nExtends the Firestore document [`delete` function](https://firebase.google.com/docs/firestore/manage-data/delete-data).\n\n- It also updates the local cache using SWR's `mutate` by deleting your document from this query and all collection queries that have fetched this document. This will prove highly convenient over the regular `delete` function from Firestore.\n- Second argument is a boolean that defaults to false. If `true`, it will not update the local cache, and instead only send delete to Firestore.\n\n## `revalidateDocument(path)`\n\nRefetch a document from Firestore, and update the local cache. Useful if you want to update a given document without calling the connected `revalidate` function from use `useDocument` hook.\n\n- Only argument is the Firestore document path (ex: `users/Fernando`)\n\n## `revalidateCollection(path)`\n\nRefetch a collection query from Firestore, and update the local cache. Useful if you want to update a given collection without calling the connected `revalidate` function from use `useCollection` hook.\n\n- Only argument is the Firestore document path (ex: `users`)\n- **Note** Calling `revalidateCollection` will update _all_ collection queries. If you're paginating data for a given collection, you probably won't want to use this function for that collection.\n\n## `fuego`\n\nThe current firebase instance used by this library. Exports the following fields:\n\n- `db`: the current firestore collection instance\n- `auth`: the `firebase.auth` variable.\n\n```js\nimport { fuego } from '@nandorojo/swr-firestore'\n\nfuego.db.doc('users/Fernando').get()\n\nfuego.auth().currentUser?.uid\n```\n\n## `getDocument(path, options?)`\n\nIf you don't want to use `useDocument` in a component, you can use this function outside of the React scope.\n\n### Arguments\n\n- **`path` required** The unique document path for your Firestore document.\n- `options`\n  - `ignoreFirestoreDocumentSnapshotField = true`. If `false`, it will return a `__snapshot` field too.\n  - `parseDates`: An array of string keys that correspond to dates in your document. [Example](#parse-date-fields-in-your-documents).\n\n### Returns\n\nA promise with the firestore doc and some useful fields. See the [useDocument](#useDocument) `data` return type for more info.\n\n## `getCollection(path, query?, options?)`\n\nIf you don't want to use `useCollection` in a component, you can use this function outside of the React scope.\n\n### Arguments\n\n- **`path` required** The unique collection path for your Firestore collection.\n  - `ignoreFirestoreDocumentSnapshotField = true`. If `false`, it will return a `__snapshot` field too.\n  - `parseDates`: An array of string keys that correspond to dates in your document. [Example](#parse-date-fields-in-your-documents).\n- `query` refer to the second argument of [`useCollection`](#useCollection).\n- `options`\n  - `ignoreFirestoreDocumentSnapshotField = true`. If `false`, it will return a `__snapshot` field too in each document.\n  - `parseDates`: An array of string keys that correspond to dates in your documents. [Example](#parse-date-fields-in-your-documents).\n\n# Features\n\n## TypeScript Support\n\nCreate a model for your `typescript` types, and pass it as a generic to `useDocument` or `useCollection`.\n\n### useDocument\n\nThe `data` item will include your TypeScript model (or `null`), and will also include an `id` string, an `exists` boolean, and `hasPendingWrites` boolean.\n\n```typescript\ntype User = {\n  name: string\n}\n\nconst { data } = useDocument<User>('users/fernando')\n\nif (data) {\n  const {\n    id, // string\n    name, // string\n    exists, // boolean\n    hasPendingWrites, // boolean\n  } = data\n}\n\nconst id = data?.id //  string | undefined\nconst name = data?.name // string | undefined\nconst exists = data?.exists // boolean | undefined\nconst hasPendingWrites = data?.hasPendingWrites // boolean | undefind\n```\n\n### useCollection\n\nThe `data` item will include your TypeScript model (or `null`), and will also include an `id` string.\n\n```typescript\ntype User = {\n  name: string\n}\n\nconst { data } = useCollection<User>('users')\n\nif (data) {\n  data.forEach(({ id, name }) => {\n    // ...\n  })\n}\n```\n\n## Shared global state between documents and collections\n\nA great feature of this library is shared data between documents and collections. Until now, this could only be achieved with something like a verbose Redux set up.\n\nSo, what does this mean exactly?\n\nSimply put, any documents pulled from a Firestore request will update the global cache.\n\n**To make it clear, let's look at an example.**\n\nImagine you query a `user` document from Firestore:\n\n```js\nconst { data } = useDocument('users/fernando')\n```\n\nAnd pretend that this document's `data` returns the following:\n\n```json\n{ \"id\": \"fernando\", \"isHungry\": false }\n```\n\n_Remember that `isHungry` is `false` here ^_\n\nNow, let's say you query the `users` collection anywhere else in your app:\n\n```js\nconst { data } = useCollection('users')\n```\n\nAnd pretend that this collection's `data` returns the following:\n\n```json\n[\n  { \"id\": \"fernando\", \"isHungry\": true },\n  {\n    //...\n  }\n]\n```\n\nWhoa, `isHungry` is now true. But what happens to the original document query? Will we have stale data?\n\n**Answer:** It will automatically re-render with the new data!\n\n`swr-firestore` uses document `id` fields to sync any collection queries with existing document queries across your app.\n\nThat means that **if you somehow fetch the same document twice, the latest version will update everywhere.**\n\n## License\n\nMIT\n","readmeFilename":"README.md"}