{"id":20327016,"url":"https://github.com/ashish-simplecoder/mini-jotai","last_synced_at":"2026-05-16T18:08:41.537Z","repository":{"id":210510975,"uuid":"725950053","full_name":"Ashish-simpleCoder/mini-jotai","owner":"Ashish-simpleCoder","description":"A mini version of Jotai (A state management library for react)","archived":false,"fork":false,"pushed_at":"2023-12-08T06:06:59.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T22:00:47.921Z","etag":null,"topics":["jotai","react","react-hooks","state-management","typescript","vitest"],"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/Ashish-simpleCoder.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}},"created_at":"2023-12-01T08:00:08.000Z","updated_at":"2025-06-03T09:26:28.000Z","dependencies_parsed_at":"2023-12-08T07:26:37.608Z","dependency_job_id":null,"html_url":"https://github.com/Ashish-simpleCoder/mini-jotai","commit_stats":null,"previous_names":["ashish-simplecoder/mini-jotai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ashish-simpleCoder/mini-jotai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashish-simpleCoder%2Fmini-jotai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashish-simpleCoder%2Fmini-jotai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashish-simpleCoder%2Fmini-jotai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashish-simpleCoder%2Fmini-jotai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashish-simpleCoder","download_url":"https://codeload.github.com/Ashish-simpleCoder/mini-jotai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashish-simpleCoder%2Fmini-jotai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274125687,"owners_count":25226491,"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-09-08T02:00:09.813Z","response_time":121,"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","react","react-hooks","state-management","typescript","vitest"],"created_at":"2024-11-14T19:46:17.407Z","updated_at":"2026-05-16T18:08:36.509Z","avatar_url":"https://github.com/Ashish-simpleCoder.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini-Jotai\n\n### Inspired with `jotai` (an awesome state management library) [read more about it](https://jotai.org/).\n\n### Big Thanks to `BlueCollarCoder` (an awesome youtuber) for making a tutorial on how to build core-jotai from scratch. [channel link](https://www.youtube.com/@jherr).\n\n### Here's the video link for the video. (https://www.youtube.com/watch?v=gg31JTZmFUw)\n\n## Features\n\n- Written in Typescript\n- Components are type-safe\n- Small and easy to use\n- Share states globally without React.context\n- Hooks for getting the state with subscription\n- Test cases written\n\n## Components\n\n- `atom` (for creating the atoms)\n- `useAtom` (getting the state and setter function for provided atom)\n- `useAtomValue` (getting only the state for provided atom)\n- `useAtomDispatch` (getting only the setter function for provided atom)\n\n## Examples\n\n### Usage with `atom` and `useAtom`\n\n```tsx\nimport { atom, useAtom } from \"mini-jotai\";\n\nconst counterAtom = atom(10);\n\nexport default function Counter() {\n  const [counter, setCounter] = useAtom(counterAom);\n\n  return (\n    \u003cdiv\u003e\n      \u003cp\u003e{counter}\u003c/p\u003e\n      \u003cbutton\n        onClick={() =\u003e\n          setCounter((old_counter) =\u003e {\n            old_counter++;\n            return old_counter;\n          })\n        }\n      \u003e\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### Usage with `atom`, `useAtomValue` and `useAtomDispatch`\n\n```tsx\nimport { atom, useAtom } from \"mini-jotai\";\n\nconst userAtom = atom({ name: \"ashish\" });\n\nexport default function Counter() {\n  // providing the getter-callback for getting the specific item from the atom\n  const username = useAtomValue(userAom, (user) =\u003e user.name);\n\n  //   atom setter function for updating the atom\n  const setUser = useAtomDispatch(userAtom);\n\n  //   if getter-callback is not provided, then `user` object will be output\n  const user = useAtomValue(userAtom);\n\n  return (\n    \u003cdiv\u003e\n      \u003cinput\n        value={username}\n        onChange={(e) =\u003e\n          setUser((old_user) =\u003e {\n            old_user.name = e.target.value;\n            return { ...old_user };\n          })\n        }\n      /\u003e\n\n      \u003cp\u003eUser:- {JSON.stringify(user)}\u003c/p\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n# Note\n- working examples available in `examples` directory in root of the projects.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashish-simplecoder%2Fmini-jotai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashish-simplecoder%2Fmini-jotai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashish-simplecoder%2Fmini-jotai/lists"}