{"id":15019374,"url":"https://github.com/dtinth/fiery","last_synced_at":"2026-03-05T19:02:37.950Z","repository":{"id":26894060,"uuid":"109822867","full_name":"dtinth/fiery","owner":"dtinth","description":"🔥 Easy declarative modern Firebase binding for React ^_^","archived":false,"fork":false,"pushed_at":"2022-12-03T15:54:21.000Z","size":676,"stargazers_count":59,"open_issues_count":16,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-09T06:21:32.899Z","etag":null,"topics":["firebase","typescript","umd"],"latest_commit_sha":null,"homepage":"https://dtinth.github.io/fiery/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtinth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-07T10:49:06.000Z","updated_at":"2025-05-19T17:30:43.000Z","dependencies_parsed_at":"2023-01-14T05:31:23.075Z","dependency_job_id":null,"html_url":"https://github.com/dtinth/fiery","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dtinth/fiery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtinth","download_url":"https://codeload.github.com/dtinth/fiery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Ffiery/sbom","scorecard":{"id":358427,"data":{"date":"2025-08-11","repo":{"name":"github.com/dtinth/fiery","commit":"52aef3a8f92f85495e85445a98a703708ccb6805"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/dtinth/open-gitops.github/SECURITY.md:1","Info: Found linked content: github.com/dtinth/open-gitops.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/dtinth/open-gitops.github/SECURITY.md:1","Info: Found text in security policy: github.com/dtinth/open-gitops.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"50 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fpm5-vv97-jfwg","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3wf4-68gx-mph8","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-6vfc-qv3f-vr6c","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-wvhm-4hhf-97x9","Warn: Project is vulnerable to: GHSA-h4hr-7fg3-h35w","Warn: Project is vulnerable to: GHSA-gj77-59wh-66hg","Warn: Project is vulnerable to: GHSA-hqhp-5p83-hx96","Warn: Project is vulnerable to: GHSA-3949-f494-cm99","Warn: Project is vulnerable to: GHSA-x7hr-w5r2-h6wg","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-884p-74jh-xrg2","Warn: Project is vulnerable to: GHSA-j7fq-p9q7-5wfv","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T10:11:04.294Z","repository_id":26894060,"created_at":"2025-08-18T10:11:04.294Z","updated_at":"2025-08-18T10:11:04.294Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","typescript","umd"],"created_at":"2024-09-24T19:53:23.928Z","updated_at":"2026-03-05T19:02:37.914Z","avatar_url":"https://github.com/dtinth.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [fiery](https://dtinth.github.io/fiery/) 🔥\n\nfiery 🔥 is the quickest and easiest way to use **Firebase Authentication** and **Firebase Realtime Database** in a React app. It uses latest React features and patterns such as [render props](https://reactjs.org/docs/render-props.html), [hooks](https://reactjs.org/docs/hooks-intro.html), and [suspense](https://reactjs.org/docs/react-api.html#reactsuspense).\n\n**Jump to:** [Installation](#installation) \u0026middot; [Demo](#demo) \u0026middot; [API Usage](#api-usage) \u0026middot; [Development](#development) \u0026middot; [License](#license)\n\n_Not production-ready:_ Although I tested it in my projects and small real-world scenarios, they are only small apps and quick prototypes. Contributions are welcome to make this more suitable for production usage.\n\n## Installation\n\nYou can install fiery 🔥 from npm:\n\n```\nnpm install --save fiery\n```\n\nIf you’re using [Create React App](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) or a module bundler such as webpack or parcel, you can import fiery using the `import` statement:\n\n```\nimport fiery from 'fiery'\n```\n\nIf you’re [using React with no build tooling](https://reactjs.org/docs/add-react-to-a-website.html), a UMD version is also available (make sure to include `react`, `react-dom`, and `firebase` before including `fiery`):\n\n```\n\u003cscript src=\"https://unpkg.com/fiery@0.5.0/umd/fiery.js\"\u003e\n\u003c/script\u003e\n```\n\n**Important:** Make sure you are using a version of React that supports the [Hooks API](https://reactjs.org/docs/hooks-intro.html).\n\n## Demo\n\n[Try it out!](https://dtinth.github.io/fiery/#DistributedCounter)\n\n\u003c!-- scripts --\u003e\n\n```js\n// Demo: DistributedCounter\n// This demo app uses only Functional Components!\n\n// Normal Firebase stuff...\n//\nconst counterRef = firebase.database().ref('demos/counter')\nconst counterDecrement = () =\u003e counterRef.transaction(c =\u003e c - 1)\nconst counterIncrement = () =\u003e counterRef.transaction(c =\u003e c + 1)\n\nfunction DistributedCounter() {\n  // The `useFirebaseDatabase` hook makes this component automatically\n  // subscribe to Firebase Realtime Database. When the data change,\n  // this component is automatically re-rendered.\n  //\n  // This is possible thanks to the Hooks API, introduced in React 16.7.0-alpha.0.\n  //\n  const counterState = fiery.useFirebaseDatabase(counterRef)\n  return (\n    \u003cdiv style={{ display: 'flex', alignItems: 'center' }}\u003e\n      \u003cdiv\u003e\n        \u003cUI.Button onClick={counterDecrement}\u003e-\u003c/UI.Button\u003e\n      \u003c/div\u003e\n      \u003cdiv style={{ textAlign: 'center', margin: '0 auto' }}\u003e\n        {counterState.loading ? (\n          \u003cUI.Loading message=\"Loading counter value\" /\u003e\n        ) : counterState.failed ? (\n          \u003cUI.ErrorMessage\n            error={counterState.error}\n            retry={counterState.retry}\n          /\u003e\n        ) : (\n          \u003cstrong\u003e{counterState.data}\u003c/strong\u003e\n        )}\n      \u003c/div\u003e\n      \u003cdiv\u003e\n        \u003cUI.Button onClick={counterIncrement}\u003e+\u003c/UI.Button\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n  )\n}\n\nReactDOM.render(\n  \u003cDistributedCounter /\u003e,\n  document.getElementById('DistributedCounter')\n)\n```\n\n```js\n// Demo: GuestbookApp\n// This demo app uses only Functional Components!\nfunction GuestbookApp() {\n  return (\n    \u003csection\u003e\n      \u003cNav /\u003e\n      \u003cGuestbookList /\u003e\n      \u003cGuestbookForm /\u003e\n    \u003c/section\u003e\n  )\n}\n\n/**\n * The navigation bar\n */\nfunction Nav() {\n  return (\n    \u003cUI.NavBar title=\"My Guestbook\"\u003e\n      \u003cUI.NavBar.Item label=\"Contact\" /\u003e\n      {/* Subscribe to the authentication state.\n          NOTE: We use the Render Props technique here to localize updates\n          to a single \u003cUI.NavBar.Item /\u003e component without requiring a new\n          React component. */}\n      \u003cfiery.Auth\u003e\n        {/* `authState` contains `loading`, `failed`, and `data` properties. */}\n        {authState =\u003e\n          authState.loading ? (\n            \u003cUI.NavBar.Item label=\"Checking auth…\" disabled /\u003e\n          ) : authState.failed ? (\n            \u003cUI.NavBar.Item\n              label=\"Auth checking failed\"\n              title={String(authState.error) + ' (click to retry)'}\n              onClick={authState.retry}\n            /\u003e\n          ) : authState.data ? (\n            \u003cUI.NavBar.Item\n              label={'Sign Out (' + authState.data.displayName + ')'}\n              onClick={signOut}\n            /\u003e\n          ) : (\n            \u003cUI.NavBar.Item label=\"Sign in with GitHub\" onClick={signIn} /\u003e\n          )\n        }\n      \u003c/fiery.Auth\u003e\n    \u003c/UI.NavBar\u003e\n  )\n}\n\n// The `signIn` and `signOut` functions uses the normal Firebase auth functions.\n// No new APIs to learn here!\n//\nfunction signIn() {\n  firebase\n    .auth()\n    .signInWithPopup(new firebase.auth.GithubAuthProvider())\n    .catch(e =\u003e window.alert(`Sorry, cannot sign in! ${e}`))\n}\nfunction signOut() {\n  if (window.confirm('RLY SIGN OUT?')) firebase.auth().signOut()\n}\n\n/**\n * The list of guestbook entries.\n */\nfunction GuestbookList() {\n  // The `useFirebaseDatabase` hook makes this component automatically\n  // subscribe to Firebase Realtime Database. When the data change,\n  // this component is automatically re-rendered.\n  //\n  const guestbookState = fiery.useFirebaseDatabase(\n    firebase\n      .database()\n      .ref('demos/guestbook')\n      .orderByChild('time')\n      .limitToLast(8)\n  )\n  return (\n    \u003cUI.EntryList\u003e\n      {guestbookState.loading ? (\n        \u003cUI.Loading message=\"Loading messages…\" /\u003e\n      ) : guestbookState.failed ? (\n        \u003cUI.ErrorMessage\n          error={guestbookState.error}\n          retry={guestbookState.retry}\n        /\u003e\n      ) : (\n        Object.keys(guestbookState.data).map(key =\u003e (\n          \u003cUI.EntryList.Item\n            key={key}\n            text={guestbookState.data[key].text}\n            name={guestbookState.data[key].name}\n          /\u003e\n        ))\n      )}\n    \u003c/UI.EntryList\u003e\n  )\n}\n\n/**\n * The form to submit a guestbook entry.\n */\nfunction GuestbookForm() {\n  // The `useFirebaseAuth` hook makes this component automatically\n  // subscribe to Firebase Authentication state. When user signs in\n  // or signs out, this component will automatically update.\n  //\n  const userState = fiery.useFirebaseAuth()\n  return userState.loading ? (\n    \u003cUI.Loading message=\"Checking authentication status…\" /\u003e\n  ) : userState.failed ? (\n    \u003cUI.ErrorMessage error={userState.error} retry={userState.retry} /\u003e\n  ) : userState.data ? (\n    \u003cUI.EntryForm onSend={text =\u003e submitForm(text, userState.data)} /\u003e\n  ) : (\n    \u003cUI.AuthenticationWall onSignIn={signIn} /\u003e\n  )\n}\n\n// Write to Firebase Realtime Database using the familiar Firebase SDK!\n//\nfunction submitForm(text, user) {\n  return firebase\n    .database()\n    .ref('demos/guestbook')\n    .push({\n      time: firebase.database.ServerValue.TIMESTAMP,\n      name: user.displayName,\n      text: text\n    })\n}\n\n// Render the app...\n//\nReactDOM.render(\u003cGuestbookApp /\u003e, document.getElementById('GuestbookApp'))\n```\n\n```js\n// Demo: SuspenseDemo\n// In this demo, there are no checks for Loading/Error state.\n// Loading state is handled by React.Suspense.\n// Error state is handled by using an Error Boundary.\n// WARNING: Unstable API!\n\nfunction SuspenseDemo() {\n  return (\n    // Set up an Error Boundary to catch errors.\n    \u003cUI.ErrorBoundary\u003e\n      \u003cSectionSelector /\u003e\n    \u003c/UI.ErrorBoundary\u003e\n  )\n}\n\nfunction SectionSelector() {\n  // `error` — always results in an error.\n  // `protected` — only logged in users can see. If you log out, you will get en error.\n  // `even` — only accessible when the Counter (1st demo) contains an even number.\n  const sections = ['intro', 'bridge', 'chorus', 'error', 'protected', 'even']\n  const [currentSection, setCurrentSection] = React.useState('intro')\n  return (\n    \u003csection\u003e\n      \u003cUI.Tabs\n        tabs={sections}\n        currentTab={currentSection}\n        onTabChange={tab =\u003e setCurrentSection(tab)}\n      /\u003e\n      \u003cUI.ContentBox\u003e\n        {/* Use `React.Suspense` to display a loading UI\n            if any child component is not ready to render */}\n        \u003cReact.Suspense fallback={\u003cUI.Loading /\u003e}\u003e\n          \u003cSectionContent sectionName={currentSection} /\u003e\n        \u003c/React.Suspense\u003e\n      \u003c/UI.ContentBox\u003e\n    \u003c/section\u003e\n  )\n}\n\nfunction SectionContent({ sectionName }) {\n  const dataRef = firebase.database().ref(`demos/tabs/${sectionName}`)\n  const dataState = fiery.useFirebaseDatabase(dataRef)\n\n  return (\n    \u003cdiv\u003e\n      {/* Use `.unstable_read()` to read the data out of Firebase.\n          Suspends rendering if data is not ready. */}\n      \u003cstrong\u003e{sectionName}:\u003c/strong\u003e {dataState.unstable_read()}\n    \u003c/div\u003e\n  )\n}\n\nReactDOM.render(\u003cSuspenseDemo /\u003e, document.getElementById('SuspenseDemo'))\n```\n\n## API Usage\n\nfiery 🔥 provides both [hooks](https://reactjs.org/hooks)-based and [render props](https://reactjs.org/docs/render-props.html)-based APIs ([rationale](https://twitter.com/dtinth/status/1055874999377047553)). These APIs will inject **DataState objects** into your component.\n\nA **DataState object** will contain `loading`, `failed`, `data`, `error`, and `retry` properties. It also contains an _experimental_ method `unstable_read()` to make React [suspend](https://reactjs.org/docs/react-api.html#reactsuspense) rendering until the data is loaded.\n\n### Synopsis\n\n- Using Hooks\n\n  ```js\n  function HookSynopsis() {\n    const counterState = fiery.useFirebaseDatabase(counterRef)\n\n    if (counterState.loading) {\n      return \u003cUI.Loading /\u003e\n    } else if (counterState.failed) {\n      return (\n        \u003cUI.ErrorMessage\n          error={counterState.error}\n          retry={counterState.retry}\n        /\u003e\n      )\n    } else {\n      return counterState.data\n    }\n  }\n  ```\n\n- Suspense + Hooks\n\n  ```js\n  function SuspenseHookSynopsis() {\n    const counterState = fiery.useFirebaseDatabase(counterRef)\n\n    return counterState.unstable_read()\n  }\n  ```\n\n- Using Render Props\n\n  ```js\n  function RenderPropsSynopsis() {\n    return (\n      \u003cfiery.Data dataRef={counterRef}\u003e\n        {counterState =\u003e\n          counterState.loading ? (\n            \u003cUI.Loading /\u003e\n          ) : counterState.failed ? (\n            \u003cUI.ErrorMessage\n              error={counterState.error}\n              retry={counterState.retry}\n            /\u003e\n          ) : (\n            counterState.data\n          )\n        }\n      \u003c/fiery.Data\u003e\n    )\n  }\n  ```\n\n- Suspense + Render Props\n  ```js\n  function SuspenseRenderPropsSynopsis() {\n    return (\n      \u003cfiery.Data dataRef={counterRef}\u003e\n        {counterState =\u003e counterState.unstable_read()}\n      \u003c/fiery.Data\u003e\n    )\n  }\n  ```\n\n### `fiery.useFirebaseAuth()`\n\nSubscribe and use authentication state.\n\n- Returns a `fiery.DataState\u003cfirebase.User | null\u003e` wrapping a [`firebase.User`](https://firebase.google.com/docs/reference/js/firebase.User) object (if signed in) or `null` (if signed out).\n\n### `fiery.Auth`\n\nRender prop version of `fiery.useFirebaseAuth`.\n\nTakes a single prop:\n\n- `children` — A **function** that determines how the authentication state should be rendered.\n  It will be called with a `RemoteDataState` wrapping a [`firebase.User`](https://firebase.google.com/docs/reference/js/firebase.User) object (if signed in) or `null` (if signed out).\n\n### `fiery.useFirebaseDatabase(dataRef: firebase.database.Query)`\n\nSubscribe and use data from Firebase Realtime Database.\n\n- `dataRef` — A [`firebase.database.Reference`](https://firebase.google.com/docs/reference/js/firebase.database.Reference) representing the data reference to fetch.\n- Returns a `fiery.DataState\u003cany\u003e` wrapping the data (if it exists) or `null` otherwise.\n\n### `fiery.Data`\n\nRender prop version of `fiery.useFirebaseDatabase`.\n\nTakes two props:\n\n- `dataRef` — A [`firebase.database.Reference`](https://firebase.google.com/docs/reference/js/firebase.database.Reference) representing the data reference to fetch.\n- `children` — A **function** that determines how the data state should be rendered.\n  It will be called with a `fiery.DataState\u003cany\u003e` wrapping the data (if it exists) or `null` otherwise.\n\n### `fiery.DataState\u003cT\u003e` — Representing remote data.\n\nWhen displaying data from remote sources, the data may not be immediately available — it may still be loading, or may have failed to load.\n\nfiery 🔥 represents this by providing you a `DataState\u003cT\u003e` object, which is a plain JS object with these properties:\n\n- `loading` — A **boolean** representing whether data is being actively loaded or not.\n- `failed` — A **boolean** representing whether data failed to load or not. **Note:** When retrying, the `failed` flag will stay `true` until new data has been loaded successfully.\n- `data` — The data of type **T**. May be `undefined` if `loading || failed`.\n- `error` — The **Error**. May be `undefined` if `!failed`.\n- `retry` — A **function** that may be called to retry the operation. May be `undefined` if `!failed || loading`.\n\nIf you use TypeScript, our typings file can help preventing you from accessing the `data` in loading or failed state. Refer to this table.\n\n| `loading` | `failed` | `data`          | `error`     | `retry`      | Remarks      |\n| --------- | -------- | --------------- | ----------- | ------------ | ------------ |\n| `true`    | `false`  | `T | undefined` | `undefined` | `undefined`  | Initial load |\n| `true`    | `true`   | `T | undefined` | `Error`     | `undefined`  | Retrying     |\n| `false`   | `false`  | `T`             | `undefined` | `undefined`  | Completed    |\n| `false`   | `true`   | `T | undefined` | `Error`     | `() =\u003e void` | Error        |\n\n**Suspense support:** A DataState object also contains an _experimental_ method, `unstable_read()` for reading the data while rendering. It [suspends rendering](https://reactjs.org/docs/react-api.html#reactsuspense) if data from Firebase is not ready. Note that this uses an _unstable_ API and is subject to change.\n\n### Looking for Firebase Firestore bindings?\n\nPlease contribute!\n\n## Development\n\nThis project uses Yarn.\n\n### Dependencies\n\nTo install dependencies, run:\n\n```\nyarn\n```\n\n### Development\n\nRun:\n\n```\nyarn dev\n```\n\nThis will run Rollup in watch mode and generate `umd/fiery.js`.\nIt will also re-generate the documentation site on change.\n\n### Building\n\nTo build the library once, run:\n\n```\nyarn build\n```\n\nThis will generate `umd/fiery.js`.\n\n### Docs\n\nThe documentation website is generated from `README.md`.\n\nTo generate the docs, run:\n\n```\nyarn docs\n```\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Ffiery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtinth%2Ffiery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Ffiery/lists"}