Note: The Guide is still only an outline. Pull Requests would be greatly appreciated!
Junctions is – at its core – a package for converting between ‘Location’ and ‘Route’ objects. So how do you actually accomplish this?
Once the pieces are in place, the process is actually incredibly simple. Assuming you have a root
Junction, all you need to do is create a
Converter object and do a conversion:
const converter = createConverter(rootJunction) const rootRoute = converter.route(location)
getRoutefunction which accepts both the location and Junction.
Converterobject lets Junctions save the result of this work for later, improving performance.