Skip to main content

api.exec()

Description

Allows triggering the inner events

Usage

api.exec(
event: string,
config: object
): void;

Parameters

  • event - (required) the event to be fired
  • config - (required) an object with configuration parameters (see the event to be fired)

Events

info

The full list of the To Do List internal events can be found here

Example

const { ToDo, Toolbar } = todo;
const { tasks, users, projects } = getData();

// create To do list
const list = new ToDo("#root", {
tasks,
users,
projects
});

// add a new project
list.api.exec("add-project", { project: { label: "New project" } });