{"id":13532641,"url":"https://github.com/jotaijs/solid-jotai","last_synced_at":"2025-08-30T14:41:39.276Z","repository":{"id":64361394,"uuid":"575101587","full_name":"jotaijs/solid-jotai","owner":"jotaijs","description":"Primitive and flexible state management for Solid based on Jotai.","archived":false,"fork":false,"pushed_at":"2025-03-15T22:03:01.000Z","size":479,"stargazers_count":34,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-21T14:48:48.861Z","etag":null,"topics":["jotai","solidjs"],"latest_commit_sha":null,"homepage":"","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/jotaijs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2022-12-06T19:01:26.000Z","updated_at":"2025-07-20T17:56:26.000Z","dependencies_parsed_at":"2025-08-19T21:31:54.080Z","dependency_job_id":"c0b4d128-7f76-43d4-af83-accdb346421b","html_url":"https://github.com/jotaijs/solid-jotai","commit_stats":{"total_commits":81,"total_committers":3,"mean_commits":27.0,"dds":0.03703703703703709,"last_synced_commit":"fe1ea24211cc049228f32e3d7369e656d691cce2"},"previous_names":["jotaijs/solid-jotai","wobsoriano/solid-jotai"],"tags_count":14,"template":false,"template_full_name":"solidjs-community/solid-lib-starter","purl":"pkg:github/jotaijs/solid-jotai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaijs%2Fsolid-jotai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaijs%2Fsolid-jotai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaijs%2Fsolid-jotai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaijs%2Fsolid-jotai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jotaijs","download_url":"https://codeload.github.com/jotaijs/solid-jotai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaijs%2Fsolid-jotai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272402825,"owners_count":24928791,"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-08-27T02:00:09.397Z","response_time":76,"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":["jotai","solidjs"],"created_at":"2024-08-01T07:01:12.503Z","updated_at":"2025-08-30T14:41:39.218Z","avatar_url":"https://github.com/jotaijs.png","language":"TypeScript","funding_links":[],"categories":["📦 Components \u0026 Libraries"],"sub_categories":["State Management"],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=solid-jotai\u0026background=tiles\u0026project=%20\" alt=\"solid-jotai\"\u003e\n\u003c/p\u003e\n\n# solid-jotai\n\n[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge\u0026logo=pnpm)](https://pnpm.io/)\n\nPrimitive and flexible state management for Solid based on [Jotai](https://github.com/pmndrs/jotai).\n\n## Quick start\n\nInstall it:\n\n```bash\npnpm add jotai solid-jotai\n```\n\nUse it:\n\n```tsx\nimport { atom, useAtom } from 'solid-jotai'\n\nconst countAtom = atom(0)\n\nfunction Counter() {\n  const [count, setCount] = useAtom(countAtom)\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003e{count()}\u003c/h1\u003e\n      \u003cbutton onClick={() =\u003e setCount(c =\u003e c + 1)}\u003eone up\u003c/button\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n## Atom\n\nAn atom represents a piece of state. All you need is to specify an initial value, which can be primitive values like strings and numbers, objects and arrays. You can create as many primitive atoms as you want.\n\n```ts\nimport { atom } from 'solid-jotai'\n\nconst countAtom = atom(0)\nconst countryAtom = atom('Japan')\nconst citiesAtom = atom(['Tokyo', 'Kyoto', 'Osaka'])\nconst mangaAtom = atom({ 'Dragon Ball': 1984, 'One Piece': 1997, 'Naruto': 1999 })\n\n// Derived atoms\nconst doubledCountAtom = atom(get =\u003e get(countAtom) * 2)\nconst sum = atom(get =\u003e get(countAtom) + get(doubledCountAtom))\n\n// Async atoms\nconst asyncAtom = atom(async () =\u003e 'hello')\n```\n\n## Suspense\n\nYou can make the read function an async function and leverage [`\u003cSuspense /\u003e`](https://www.solidjs.com/docs/latest/api#suspense):\n\n```tsx\nconst urlAtom = atom('https://jsonplaceholder.typicode.com/todos')\nconst fetchUrlAtom = atom(\n  async (get) =\u003e {\n    const response = await fetch(get(urlAtom))\n    return await response.json()\n  }\n)\n\nfunction TodoList() {\n  const [json] = useAtom(fetchUrlAtom)\n  // json is a resource so loading, status\n  // and error props are available\n  return \u003cdiv\u003e{JSON.stringify(json())}\u003c/div\u003e\n}\n\nfunction App() {\n  return (\n    \u003cSuspense fallback={\u003cLoading /\u003e}\u003e\n      \u003cTodoList /\u003e\n    \u003c/Suspense\u003e\n  )\n}\n```\n\nRead more about [Jotai](https://github.com/pmndrs/jotai) here.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotaijs%2Fsolid-jotai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjotaijs%2Fsolid-jotai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotaijs%2Fsolid-jotai/lists"}