Skip to main content

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 data
  • users - (optional) an array of objects with users data
  • projects - (optional) an array of objects with projects data
  • tags - (optional) - an array with a list of tags
  • activeProject - (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