{"id":13681145,"url":"https://github.com/prescottprue/redux-firestore","last_synced_at":"2025-05-14T10:08:40.419Z","repository":{"id":25695153,"uuid":"105689653","full_name":"prescottprue/redux-firestore","owner":"prescottprue","description":"Redux bindings for Firestore","archived":false,"fork":false,"pushed_at":"2025-03-24T02:45:48.000Z","size":7551,"stargazers_count":574,"open_issues_count":86,"forks_count":102,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-24T03:30:54.833Z","etag":null,"topics":["firebase","firestore","react","react-redux","react-redux-firebase","redux","redux-enhancer","redux-middleware"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/prescottprue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"prescottprue","open_collective":"react-redux-firebase"}},"created_at":"2017-10-03T18:45:19.000Z","updated_at":"2025-02-27T01:05:57.000Z","dependencies_parsed_at":"2024-05-13T17:58:06.978Z","dependency_job_id":"06550f0f-f930-4105-af15-395332e894cc","html_url":"https://github.com/prescottprue/redux-firestore","commit_stats":{"total_commits":444,"total_committers":28,"mean_commits":"15.857142857142858","dds":0.6531531531531531,"last_synced_commit":"3a3933b7c8584530b52670d2fcd36cb6818c8f6a"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prescottprue%2Fredux-firestore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prescottprue%2Fredux-firestore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prescottprue%2Fredux-firestore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prescottprue%2Fredux-firestore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prescottprue","download_url":"https://codeload.github.com/prescottprue/redux-firestore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217784,"owners_count":20579297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","firestore","react","react-redux","react-redux-firebase","redux","redux-enhancer","redux-middleware"],"created_at":"2024-08-02T13:01:27.063Z","updated_at":"2025-04-11T03:32:55.178Z","avatar_url":"https://github.com/prescottprue.png","language":"JavaScript","funding_links":["https://patreon.com/prescottprue","https://opencollective.com/react-redux-firebase"],"categories":["JavaScript"],"sub_categories":[],"readme":"# redux-firestore\n\n\u003e Redux bindings for Firestore. Provides low-level API used in other libraries such as [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase)\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][npm-downloads-image]][npm-url]\n[![License][license-image]][license-url]\n[![Code Style][code-style-image]][code-style-url]\n[![Build Status][build-image]][build-status-url]\n[![Code Coverage][coverage-image]][coverage-url]\n[![semantic-release][semantic-release-image]][semantic-release-url]\n\n[![Gitter][gitter-image]][gitter-url]\n\n\u003c!-- [![Quality][quality-image]][quality-url] --\u003e\n\n## Installation\n\n```sh\nnpm install redux-firestore --save\n```\n\nThis assumes you are using [npm](https://www.npmjs.com/) as your package manager.\n\nIf you're not, you can access the library on [unpkg](https://unpkg.com/redux-firestore@latest/dist/redux-firestore.min.js), download it, or point your package manager to it. Theres more on this in the [Builds section below](#builds)\n\n## Complementary Package\n\nMost likely, you'll want react bindings, for that you will need [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase). You can install the current version it by running:\n\n```sh\nnpm install --save react-redux-firebase\n```\n\n[react-redux-firebase](https://github.com/prescottprue/react-redux-firebase) provides [`withFirestore`](http://react-redux-firebase.com/docs/api/withFirestore.html) and [`firestoreConnect`](http://react-redux-firebase.com/docs/api/firestoreConnect.html) higher order components, which handle automatically calling `redux-firestore` internally based on component's lifecycle (i.e. mounting/un-mounting)\n\n# Overview\n\n- [Getting Started](./docs/getting-started.md)\n  - [Components](./docs/getting-started.md#components)\n  - [Functional Components](./docs/getting-started.md#functional-components)\n  - [Class Components](./docs/getting-started.md#class-components)\n- API\n  - [Mutate](./docs/saving.md)\n    - [Optimistic Writes](./docs/saving.md#optimistic-writes)\n    - [Creation](./docs/saving.md#creation)\n    - [Updates](./docs/saving.md#updates)\n    - [Batches](./docs/saving.md#batching)\n    - [Transactions](./docs/saving.md#transactions)\n    - [Atomic Updates](./docs/saving.md#atomic-updates)\n    - [Not Supported](./docs/saving.md#not-supported)\n  - [Query](./docs/query.md)\n    - [Syntax](./docs/query.md#syntax)\n    - [Types](./docs/query.md#types)\n    - [Population](./docs/query.md#population)\n    - [Config Options](./docs/query.md#config-options)\n  - [Cache Reducer](./docs/cache.md)\n   - [Structure](./docs/cache.md#structure)\n\n## API Quick Start\n\n#### Load data\n\nConstruct a Firestore query, attach listeners for updates and get the data from the selector.\n\n```js\nconst MyController = () =\u003e {\n  // 1. construct query\n  const taskQuery = {\n    collection: `workspace/MySpace/tasks`,\n    where:[\n      ['status', '\u003c', 1],\n      ['deleted', '==', false]\n    ],\n    orderBy: ['createdAt', 'desc'],\n    storeAs: 'tasksStarted',\n  }\n  \n  // 2. load \u0026 attached listeners for document changes\n  useFirestoreConnect([taskQuery]);\n\n  // 3. Get results\n  const tasks = useSelector(state =\u003e \n    state.firestore.cache['tasksStarted'].docs\n  );\n  \n  // 4. Display when the data returns\n  return (\u003col\u003e\n    {tasks \u0026\u0026 tasks.map(({id, title}) =\u003e (\n      \u003cli key={id}\u003etitle\u003c/li\u003e\n    ))}\n  \u003c/ol\u003e);\n};\n```\n\n#### Saving Data\n\nUse redux-firestore's mutate function to queue changes to Firestore\nand see the optimitic results instantly in the UI.\n\n```js\nconst MyController = (task) =\u003e {\n  const changeTitle = useCallback(({id, path, title}) =\u003e {\n    dispatch(\n      createMutate({\n        doc: id, \n        collection: path, \n        title\n      }))\n      .catch((error) =\u003e { alert(error) });\n  })\n  \n  return (\u003cTaskView onSave={changeTitle} /\u003e);\n};\n```\n\n## Roadmap\n\n- Automatic support for documents that have a parameter and a subcollection with the same name (currently requires `storeAs`)\n- Support for Passing a Ref to `setListener` in place of `queryConfig` object or string\n\nPost an issue with a feature suggestion if you have any ideas!\n\n[npm-image]: https://img.shields.io/npm/v/redux-firestore.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/redux-firestore\n[npm-downloads-image]: https://img.shields.io/npm/dm/redux-firestore.svg?style=flat-square\n[quality-image]: http://npm.packagequality.com/shield/redux-firestore.svg?style=flat-square\n[quality-url]: https://packagequality.com/#?package=redux-firestore\n[build-image]: https://img.shields.io/github/workflow/status/prescottprue/redux-firestore/NPM%20Package%20Publish?style=flat-square\n[build-status-url]: https://travis-ci.org/prescottprue/redux-firestore\n[climate-image]: https://img.shields.io/codeclimate/github/prescottprue/redux-firestore.svg?style=flat-square\n[climate-url]: https://codeclimate.com/github/prescottprue/redux-firestore\n[coverage-image]: https://img.shields.io/codecov/c/github/prescottprue/redux-firestore.svg?style=flat-square\n[coverage-url]: https://codecov.io/gh/prescottprue/redux-firestore\n[license-image]: https://img.shields.io/npm/l/redux-firestore.svg?style=flat-square\n[license-url]: https://github.com/prescottprue/redux-firestore/blob/main/LICENSE\n[code-style-image]: https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square\n[code-style-url]: https://github.com/airbnb/javascript\n[gitter-image]: https://img.shields.io/gitter/room/redux-firestore/gitter.svg?style=flat-square\n[gitter-url]: https://gitter.im/redux-firestore/Lobby\n[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprescottprue%2Fredux-firestore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprescottprue%2Fredux-firestore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprescottprue%2Fredux-firestore/lists"}