undo()
Description
Reverts the last operation in To Do List
info
If you set the history.projects parameter to true, you will be able to manage the history of changes for each project separately; otherwise, you will be able to manage the history of changes for the whole app.
Usage
undo(): void;
Example
const { ToDo } = todo;
const { tasks, users, projects, tags } = getData();
// create To Do List
const list = new ToDo("#root", {
tasks,
users,
projects,
tags,
history: { projects: false, limit: 10 }
});
list.addTask({ text: "New task 1 });
list.undo();
Change log: The undo() method was added in v1.3
Related API: