api.getState()
Description
Gets an object with the current properties of the DataStore of To Do List
Usage
api.getState(): object;
Returns
The method returns an object with the following properties:
{
activeProject: object,
tasks: object,
id: object,
projects: object,
readonly: object,
tags: object,
taskShape: object,
selected: object,
users: object,
historyState: object
}
Example
const { ToDo, Toolbar } = todo;
const { tasks, users, projects } = getData();
// create To do list
const list = new ToDo("#root", {
tasks,
users,
projects
});
const state = list.api.getState();
console.log(state);
Change log: The historyState
parameter was added in v1.3