api.getReactiveState()
Description
Gets an object with the reactive properties of the DataStore of To Do List
Usage
api.getReactiveState(): object;
Returns
The method returns an object with the following properties:
{
activeProject: {set: any, update: any, subscribe: any}
tasks: {...}
id: {...}
projects: {...}
readonly: {...}
tags: {...}
taskShape: {...}
selected: {...}
users: {...}
}
Example
const { ToDo, Toolbar } = todo;
const { tasks, users, projects } = getData();
// create To do list
const list = new ToDo("#root", {
tasks,
users,
projects
});
// subscribe to the task selection
list.api.getReactiveState().selected.subscribe((value) => {
console.log(value);
// other actions
});