{"id":13429602,"url":"https://github.com/sandiiarov/use-simple-undo","last_synced_at":"2026-01-12T03:06:54.215Z","repository":{"id":37579948,"uuid":"156754728","full_name":"sandiiarov/use-simple-undo","owner":"sandiiarov","description":"🔄 Simple solution to handle undo\\redo turned into React Hooks ","archived":false,"fork":false,"pushed_at":"2024-09-17T11:36:55.000Z","size":4171,"stargazers_count":30,"open_issues_count":31,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-17T14:16:22.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sandiiarov.github.io/use-simple-undo","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandiiarov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-11-08T19:00:08.000Z","updated_at":"2024-09-16T14:28:53.000Z","dependencies_parsed_at":"2023-10-05T06:10:53.241Z","dependency_job_id":"d065ab2c-552d-4a10-817d-bf1e5148e8a5","html_url":"https://github.com/sandiiarov/use-simple-undo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandiiarov%2Fuse-simple-undo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandiiarov%2Fuse-simple-undo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandiiarov%2Fuse-simple-undo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandiiarov%2Fuse-simple-undo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandiiarov","download_url":"https://codeload.github.com/sandiiarov/use-simple-undo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822309,"owners_count":20353496,"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":[],"created_at":"2024-07-31T02:00:42.355Z","updated_at":"2026-01-12T03:06:54.160Z","avatar_url":"https://github.com/sandiiarov.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"![npm](https://img.shields.io/npm/dt/use-simple-undo.svg)\n![npm](https://img.shields.io/npm/v/use-simple-undo.svg)\n![NpmLicense](https://img.shields.io/npm/l/use-simple-undo.svg)\n\n**Use Simple Undo** - Simple solution to handle undo\\redo turned into React Hooks.\nRead about [Hooks](https://reactjs.org/docs/hooks-intro.html) feature.\n\n## Documentation\n\nhttps://sandiiarov.github.io/use-simple-undo\n\n## Installation\n\n\u003e Note: React 16.8+ is required for Hooks.\n\n### With npm\n\n```sh\nnpm i use-simple-undo\n```\n\n### Or with yarn\n\n```sh\nyarn add use-simple-undo\n```\n\n## Usage\n\n```jsx\nimport useSimpleUndo from 'use-simple-undo';\n```\n\n```jsx\nconst Counter = () =\u003e {\n  const [state, cursor, setValue, { undo, redo }] = useSimpleUndo(0);\n\n  const value = state[cursor];\n\n  const increment = () =\u003e setValue(value + 1);\n  const decrement = () =\u003e setValue(value - 1);\n\n  return (\n    \u003c\u003e\n      \u003cdiv\u003e{value}\u003c/div\u003e\n      \u003cbutton onClick={increment}\u003eincrement\u003c/button\u003e\n      \u003cbutton onClick={decrement}\u003edecrement\u003c/button\u003e\n      \u003cbutton onClick={undo}\u003eundo\u003c/button\u003e\n      \u003cbutton onClick={redo}\u003eredo\u003c/button\u003e\n    \u003c/\u003e\n  );\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandiiarov%2Fuse-simple-undo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandiiarov%2Fuse-simple-undo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandiiarov%2Fuse-simple-undo/lists"}