Memento design pattern in Svelte
npm install @macfja/svelte-undoableMemento design pattern in Svelte
```
npm install @macfja/svelte-undoable
`javascript
import { undoable } from "@macfja/svelte-undoable"
let name = undoable("John")
$name = "Jeanne"
$name = "Doe"
name.undo()
// Now the value of $name is "Jeanne"
name.undo()
// Now $name is "John"
name.redo()
// Now $name is "Jeanne" again
`
`html
20, you can only go back to 2)
``
(REPL)
Contributions are welcome. Please open up an issue or create PR if you would like to help out.
Read more in the Contributing file
The MIT License (MIT). Please see License File for more information.