src/SimpleReactRouter.js
function resolver(routes) {
    return async function(context) {
        const uri = context.error ? '/error' : context.pathname;
        return routes.find(route => route.matchRoute(uri));
    }
}
function resolver(routes) {
    return async function(context) {
        const uri = context.error ? '/error' : context.pathname;
        return routes.find(route => route.matchRoute(uri));
    }
}
function resolver ( routes ) { return async function ( context ) { const uri = context . error ? '/error' : context . pathname ; return routes . find ( route => route . matchRoute ( uri ) ) ; } }
Resolve the component to render based on the pathname given as the parameter's
property.

If the location cannot be resolved then throw an error. The resolver will resolve
the component configured against /error to render an error page

@param {Object} context - an object containing a pathname to resove or an error

TODO replace this error approach
Resolve the component to render based on the pathname given as the parameter s property .