The second fact knows about the first. That makes the first fact (chores) a predecessor to the second (trash). The order between these two is known. Chores will always come before trash. But facts with no such relationship can occur in any order.

Watches

Now that you can express that chores is a predecessor of trash, you might want to watch for all facts with that same predecessor. These are called successors. For example, you might want to find all of the tasks on the chores list. Provide a template that all desired facts will fit. For example, for a given list, this template will match all tasks on that list:

functiontasksInList(l) {
return {
type:"Task",
list: l
};
}

When a fact matching the template is found, we want to call a function. We'll watch the template, and call a function when the results change.

When this query is created, only the existing tasks that have not been completed will be added to the UI. So you will see "Empty the dishwasher", but not "Take out the trash". But what about when a task changes? We want to remove tasks from the UI once they are marked completed. So let's add another callback to the query.