Concepts

Jinaga is a state-management framework for building web and mobile applications. When building an application with Jinaga, you perform three basic operations:

  • Storing information
  • Writing specifications
  • Projecting results

You store information whenever the user performs an action. This saves the data in local storage, sends it to the server, and updates the user interface.

await jinagaClient.Fact(new Post(
  DateTime.UtcNow,
  site
));

You write a specification to describe the shape of the information you want to retrieve. A specification function matches a template, and applies conditions.

var postsInSite = Given<Site>.Match((site, facts) =>
  from post in facts.OfType<Post>()
  where post.site == site
  select new
  {
    hash = jinagaClient.Hash(post),
    titles =
      from title in facts.OfType<PostTitle>()
      where title.post == post
      select title.value
  }
);

You retrieve information any time you need the application to answer a question. It could be a query that you run just when you need the data.

var posts = await jinagaClient.Query(postsInSite, site);

Or it could be watching to for changes so that you can update the UI.

var observer = jinagaClient.Watch(postsInSite, site, projection => {
  // Update the view model.
});

See Also

Jinaga is a product of Jinaga LLC.

Michael L Perry, President