Skip to content

The Routing System

The software is designed to be url driven, that is, valid urls will automatically load appropriate module data, filters, collections and items.

The process starts with vue-router middleware handleRouteChange(). The main stages are:

  • planTransition() a simple state machine that observes the from and to handle objects and determines the validity of the transition, and if valid, determines the actions needed to complete it and their order (e.g. load trio, load collection)
  • prepareForNewRoute() run the list of required actions received from planTransition(). Those typically include
    • parsing and validation of url parameters
    • sending request(s) to the server
    • waiting for response(s)
    • error handling and re-routing or
    • extracting, modifying and saving respose data locally into appropiate stores