parse()
Description
Loads data into To Do List
Usage
parse({
tasks?: [],
users?: [],
projects?: [],
tags?: [],
activeProject?: string
}): void;
Parameters
tasks
- (optional) an array of objects with tasks datausers
- (optional) an array of objects with users dataprojects
- (optional) an array of objects with projects datatags
- (optional) an array with a list of tagsactiveProject
- (optional) the ID of the active project
Example
const { ToDo, Toolbar } = todo;
const list = new ToDo("#root", {});
const toolbar = new Toolbar("#toolbar", {
api: list.api,
});
// parse prepared data into the component
list.parse({
tasks,
users,
projects,
});
Related article: Loading and storing data