Skip to main content

unassign-user

Description

Fires when a user is unassigned from a task

Usage

"unassign-user": ({
id: string | number,
userId: string | number
}) => void;

Parameters

The callback of the unassign-user event can take an object with the following parameters:

  • id - (required) the id of a task
  • userId - (required) the id of the user unassigned from the task
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 "unassign-user" event
list.api.on("unassign-user", ({id, userId}) => {
console.log("The", userId, "user is unassigned from the", id, "task");
});

Related article: Task users