Preposition

A chain of templates used in j.query or j.watch.

Begin the chain by calling j.for. Extend it by calling then.

Examples

Build a preposition chain.

Blog Blog.Post Blog.Post Blog.Person Blog.Person Blog.Post->Blog.Person author Blog.Post.Tags Blog.Post.Tags Blog.Post.Tags->Blog.Post post
function postsByAuthor(a) {
    return j.match({
        type: 'Blog.Post',
        author: a
    });
}

function tagsForPost(p) {
    return j.match({
        type: 'Blog.Post.Tags',
        post: p
    });
}

const tags = await j.query(person, j
    .for(postsByAuthor)
    .then(tagsForPost));

See Also