{"repo":"eihabkhan/reddojs","free":true,"listed":false,"github":"https://github.com/eihabkhan/reddojs","clone":"git clone https://github.com/eihabkhan/reddojs.git","description":"A tiny Undo/Redo Library for JavaScript, React, Vue, and Svelte","language":"TypeScript","stars":122,"topics":["history","redo","undo","undo-redo","react","svelte","vanilla-js","vue"],"license":"MIT","category":"ui-components","readme_excerpt":"Reddo.js A tiny undo/redo utility package for JavaScript, React, Vue, and Svelte. Tiny. Less than 1kb (gzipped). No dependencies. Zero dependencies Core lib has no runtime deps Dead simple Just import hook, execute, undo, redo Framework agnostic Core works anywhere, with official React, Vue & Svelte adapters TypeScript first Fully typed. Command coalescing Automatically groups related commands (e.g., typing in a text field, changing a color in a color picker) Table of Contents Installation React Vue Svelte Vanilla API Reference Command HistoryOptions Usage React Vue Svelte Vanilla Installation React Vue Svelte Vanilla CDN You can also use Reddo.js via CDN: API Reference Command A command object represents an action that can be executed and undone. Property Type Description ---------- ------ ------------- key string (optional) When set, consecutive commands with the same key are merged into a single undo operation. Useful for text input, color pickers, sliders, etc. do () = void The function that performs the action undo () = void The function that reverses the action HistoryOptions Configuration options for the history manager. Option Type Default Description -------- ------ --------- ------------- size number 30 Maximum number of commands to keep in history coalesce boolean true When enabled, consecutive commands with the same key are merged on undo Return Values All adapters ( useHistory ) return: Property Type Description ---------- ------ ------------- execute (cmd: Comma","default_branch":null,"files":null,"tree":[],"storefront":"/r/eihabkhan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/eihabkhan/reddojs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}