delete-project
Description
Fires when removing a project
Usage
"delete-project": ({
id: string | number
}) => void;
Parameters
The callback of the delete-project event can take an object with the following parameters:
id
- (required) the ID of a project
info
To handle the inner events, you can use the Event Bus methods
Example
const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();
const list = new ToDo("#root", {
tasks,
projects,
users
});
const toolbar = new Toolbar("#toolbar", {
api: list.api,
});
// subscribe to the "delete-project" event
list.api.on("delete-project", ({id}) => {
console.log("The project with ID:", id, "is removed");
});
Related article: Operations with projects