{"id":20461028,"url":"https://github.com/ericgj/model-undoable","last_synced_at":"2025-04-13T06:16:10.998Z","repository":{"id":9380874,"uuid":"11240077","full_name":"ericgj/model-undoable","owner":"ericgj","description":"undo/redo behavior for component/model","archived":false,"fork":false,"pushed_at":"2015-06-21T17:58:22.000Z","size":185,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T06:15:48.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ericgj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-07T20:59:30.000Z","updated_at":"2019-07-15T21:08:57.000Z","dependencies_parsed_at":"2022-08-29T21:50:32.828Z","dependency_job_id":null,"html_url":"https://github.com/ericgj/model-undoable","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/ericgj%2Fmodel-undoable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fmodel-undoable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fmodel-undoable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fmodel-undoable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgj","download_url":"https://codeload.github.com/ericgj/model-undoable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670438,"owners_count":21142905,"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-11-15T12:22:54.937Z","updated_at":"2025-04-13T06:16:10.979Z","avatar_url":"https://github.com/ericgj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# model-undoable\n\n  Undo/redo behavior for component/model-ish classes/objects\n\n## Installation\n\n    $ component install ericgj/model-undoable\n\n## Examples\n\nFor component/model, just `use` the plugin:\n\n```javascript\n  var undoable = require('model-undoable')\n    , model    = require('model')\n\n  var Person = model('person')\n                 .attr('id')\n                 .attr('name')\n                 .attr('email')\n                 .use(undoable);\n```\n\nNow your model instances have `undo`, `redo`, `undoAll`, `redoAll` methods.\n\n  - `undo` and `redo` work as expected on individual model changes.\n\n  - `undoAll` undoes all changes back to the last save. \n\n  - `redoAll` redoes all undone changes from the last save to the most current.\n\n  - Model instances will also emit `undo` and `redo` events.\n\nYou can also mix it into model instances directly (or into similar objects that \nemit `change` events such as [react][react]-ified objects):\n\n```javascript\n  var undoable = require('model-undoable')\n\n  var person = new Person();\n  undoable(person);\n```\n\n## Motivation\n\nMainly I wrote it for `undoAll` for reverting all changes made in a reactive \nview. Obviously most browsers give you individual undo/redo.\n\n\n## License\n\n  MIT\n\n\n[react]: https://github.com/timoxley/react\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fmodel-undoable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgj%2Fmodel-undoable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fmodel-undoable/lists"}