{"id":19630947,"url":"https://github.com/binfoe/lrhs","last_synced_at":"2025-10-04T23:14:53.092Z","repository":{"id":189346077,"uuid":"680407723","full_name":"binfoe/lrhs","owner":"binfoe","description":"lightweight react hook store","archived":false,"fork":false,"pushed_at":"2024-06-06T03:10:58.000Z","size":270,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T09:29:16.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binfoe.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,"publiccode":null,"codemeta":null}},"created_at":"2023-08-19T06:28:12.000Z","updated_at":"2024-06-06T03:11:01.000Z","dependencies_parsed_at":"2023-08-19T16:26:20.409Z","dependency_job_id":"33351b3f-a04e-460d-9bb2-b28d54685e8a","html_url":"https://github.com/binfoe/lrhs","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"f444b428e4aea55baf7867f9ab9a09af9a0cb08b"},"previous_names":["yuhangge/kkstore","yuhangge/rlstore","binfoe/lrhs","yuhangge/lrhs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/binfoe/lrhs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binfoe%2Flrhs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binfoe%2Flrhs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binfoe%2Flrhs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binfoe%2Flrhs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binfoe","download_url":"https://codeload.github.com/binfoe/lrhs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binfoe%2Flrhs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278386130,"owners_count":25978113,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T12:07:13.079Z","updated_at":"2025-10-04T23:14:53.065Z","avatar_url":"https://github.com/binfoe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# light react hook store\n\n\u003e react light weight data share store, with strict type.\n\n## Usage\n\n```ts\n// /src/store/somestore.ts\nimport store from 'lrhs';\nconst { useStore } = store({\n  a: 10,\n  b: 'hello',\n});\nexport { useStore };\n\n// /src/app/pages/somecomponent.tsx\nimport { useStore } from '@/store/somestore.ts';\nconst [a, setA] = useStore('a'); //\nsetA('ok'); // bad. compile error, type of a must be number\nsetA(10); // ok\nsetA((oldValue) =\u003e oldValue + 1); // can be set function\nconst [c] = useStore('c'); // bad. compile error, somestore has no propery named c\n\n// another example\nimport { createStore } from 'lrhs';\nconst globalStore = createStore({\n  a: 10,\n  b: 'hello',\n});\n\nglobalStore.get('a'); // get property value\nglobalStore.set('a', 20);\nglobalStore.set('b', (oldValue) =\u003e `${oldValue}.new`);\nglobalStore.getStore(); // get whole store data object\n\nconst [a, setA] = globalStore.useStore('a');\nconsole.log(a);\nsetA(30);\n\n// hook on updated\nglobalStore.hook('a', (newValue) =\u003e {\n  localStorage.setItem('SOME_KEY', JSON.stringify(newValue));\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinfoe%2Flrhs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinfoe%2Flrhs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinfoe%2Flrhs/lists"}