{"id":20206197,"url":"https://github.com/theneuronproject/ef-time-traveler","last_synced_at":"2025-04-10T12:25:12.073Z","repository":{"id":35099071,"uuid":"206508245","full_name":"TheNeuronProject/ef-time-traveler","owner":"TheNeuronProject","description":"Time travel support for ef.js","archived":false,"fork":false,"pushed_at":"2023-01-05T22:21:34.000Z","size":459,"stargazers_count":4,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-01T20:08:39.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/TheNeuronProject.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}},"created_at":"2019-09-05T08:00:46.000Z","updated_at":"2024-04-22T01:56:11.000Z","dependencies_parsed_at":"2023-01-15T14:00:31.957Z","dependency_job_id":null,"html_url":"https://github.com/TheNeuronProject/ef-time-traveler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNeuronProject%2Fef-time-traveler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNeuronProject%2Fef-time-traveler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNeuronProject%2Fef-time-traveler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNeuronProject%2Fef-time-traveler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheNeuronProject","download_url":"https://codeload.github.com/TheNeuronProject/ef-time-traveler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224569953,"owners_count":17333221,"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-14T05:22:04.784Z","updated_at":"2024-11-14T05:22:05.372Z","avatar_url":"https://github.com/TheNeuronProject.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ef-time-traveler\nA time traveler written for ef, written with ef\n\n## Usage\n\nImport the time traveler and template to be time-traveled\n```javascript\nimport TimeTraveler from 'ef-time-traveler'\nimport Template from './template.eft'\n```\n\nCreate a time traveler instance and a new template instance\n```javascript\nconst timeTraveler = new TimeTraveler()\nconst template = new Template()\n```\n\n---\n\nRegister the template instance to the time traveler instance. Specify keys to tell the time traveler to record which things needed:\n```javascript\ntimeTraveler.register(template, ['key1', 'key2.subProp'])\n```\n---\n\n\nThen do some operations on template instance, history will be automatically recorded\n\n---\n\n\nGet how many history is recorded. This is a read only value:\n```javascript\nconst count = timeTraveler.historyCount\n```\n\n\nJump back to history at position `X\u003cint\u003e`\n```javascript\ntimeTraveler.currentPos = X\n```\n\nRecording is disabled when viewing history. Resume to the last history position in order to continue editing:\n```javascript\ntimeTraveler.currentPos = timeTraveler.historyCount\n```\n\nRevert `X\u003cint\u003e` history records. Newer history record is then discarded:\n```javascript\ntimeTraveler.revert(X)\n```\n\nReset to position `X\u003cint\u003e` and then all newer history is discarded:\n\n```javascript\ntimeTraveler.reset(X)\n```\n\n## Notice\n\nThis time traveler only records changes, so you may need to be careful when manually setting `currentPos`. Reverting history would lead to a full history reconstruct, so use carefully to avoid performance issue.\n\n\n## License\n[MIT](http://cos.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheneuronproject%2Fef-time-traveler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheneuronproject%2Fef-time-traveler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheneuronproject%2Fef-time-traveler/lists"}