{"id":18607380,"url":"https://github.com/addono/react-persisted-global-state","last_synced_at":"2026-03-11T04:03:30.776Z","repository":{"id":82277185,"uuid":"584389261","full_name":"Addono/react-persisted-global-state","owner":"Addono","description":"Simple React hook for global, local storage persisted state","archived":false,"fork":false,"pushed_at":"2024-04-13T09:21:04.000Z","size":3967,"stargazers_count":3,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-13T22:12:45.574Z","etag":null,"topics":["github-actions","global","hooks","local-storage","npm","persist","react","state"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-persisted-global-state","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/Addono.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-01-02T12:35:23.000Z","updated_at":"2024-04-15T05:34:47.351Z","dependencies_parsed_at":"2023-12-14T05:21:39.981Z","dependency_job_id":"b5d9179b-b1e8-484a-b652-5b2174de2100","html_url":"https://github.com/Addono/react-persisted-global-state","commit_stats":{"total_commits":192,"total_committers":3,"mean_commits":64.0,"dds":"0.23958333333333337","last_synced_commit":"8a62d7363a9eec14623fa11f06d58be3895f5fa4"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Freact-persisted-global-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Freact-persisted-global-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Freact-persisted-global-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Freact-persisted-global-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/react-persisted-global-state/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290041,"owners_count":21078923,"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":["github-actions","global","hooks","local-storage","npm","persist","react","state"],"created_at":"2024-11-07T02:29:16.175Z","updated_at":"2026-03-11T04:03:30.750Z","avatar_url":"https://github.com/Addono.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-persisted-global-state\n\n[![License](https://img.shields.io/github/license/Addono/react-persisted-global-state?style=flat-square)](https://github.com/Addono/react-persisted-global-state/blob/master/LICENSE)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://img.shields.io/badge/project%20status-Active-greengrass?style=flat-square)](https://www.repostatus.org/#active)\n[![Depfu](https://img.shields.io/depfu/Addono/react-persisted-global-state?style=flat-square)](https://depfu.com/github/Addono/react-persisted-global-state)\n[![npm](https://img.shields.io/npm/dt/react-persisted-global-state?style=flat-square)](https://www.npmjs.com/package/react-persisted-global-state)\n[![npm](https://img.shields.io/npm/v/react-persisted-global-state?style=flat-square)](https://www.npmjs.com/package/react-persisted-global-state)\n[![GitHub stars](https://img.shields.io/github/stars/Addono/react-persisted-global-state?style=flat-square)](https://github.com/Addono/react-persisted-global-state/stargazers)\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## About\n\nSimple React hook for global state which is persisted to Local Storage.\n\nThis allows sharing state between multiple components or different instance of the same component, all while the changes are persisted to the browser's Local Storage.\n\n## Installing\n\nInstall `react-persisted-global-state` and its peer-dependencies:\n\n```bash\n# For users of npm\nnpm install --save react-persisted-global-state react-use\n\n# For users of Yarn\nyarn add react-persisted-global-state react-use\n```\n\n## Usage\n\n```tsx\nimport { createPersistedGlobalState } from 'react-persisted-global-state';\n\n// Register a re-usable instance of our global state store\nconst useMyPersistedGlobalState = createPersistedGlobalState\u003cstring\u003e(\n  'my-localstorage-key',\n  'Hello, world!'\n);\n\nconst MyComponent = () =\u003e {\n  const [state, setState, removeState] = useMyPersistedGlobalState();\n\n  return (\n    \u003cinput type=\"text\" value={state} onChange={e =\u003e setState(e.target.value)} onClear /\u003e\n  );\n};\n```\n\n## Releasing\n\nWe use [`release-it`](https://github.com/release-it/release-it) to automate our creating releases for this application. A new release can be rolled out by running:\n\n```bash\nyarn release\n```\n\n## ✨ Contributors \u003ca name = \"contributors\"\u003e\u003c/a\u003e\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://aknapen.nl\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/15435678?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdriaan Knapen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Addono/react-persisted-global-state/commits?author=Addono\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#tool-Addono\" title=\"Tools\"\u003e🔧\u003c/a\u003e \u003ca href=\"https://github.com/Addono/react-persisted-global-state/commits?author=Addono\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/Addono/react-persisted-global-state/commits?author=Addono\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Freact-persisted-global-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Freact-persisted-global-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Freact-persisted-global-state/lists"}