Skip to main content

update-project

Description

Fires when updating a project

Usage

"update-project": ({
id: string | number,
project: object
}) => void;

Parameters

The callback of the update-project event can take an object with the following parameters:

  • id - (required) the id of the updated project
  • project - (required) the object of the updated project
    • label - (optional) the name of the 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 "update-project" event
list.api.on("update-project", ({id, project}) => {
console.log("The label of the project with ID:", id, "is changed to", project.label);
});

Related article: Operations with projects