src/connectHistory.js
function createDefaultHandler (history) {
  return function (context, runMiddleware) {
    runMiddleware(context, function (err, redirect) {
      if (err) {
        console.error(`${context.uri} -> ${err.message}`, err);
      } else if (redirect) {
        history.replace(redirect);
      }
    });
  }
}
function createDefaultHandler (history) {
  return function (context, runMiddleware) {
    runMiddleware(context, function (err, redirect) {
      if (err) {
        console.error(`${context.uri} -> ${err.message}`, err);
      } else if (redirect) {
        history.replace(redirect);
      }
    });
  }
}
function createDefaultHandler ( history ) { return function ( context , runMiddleware ) { runMiddleware ( context , function ( err , redirect ) { if ( err ) { console . error ( ` ${ context . uri } ${ err . message } ` , err ) ; } else if ( redirect ) { history . replace ( redirect ) ; } } ) ; } }
Create a default handler for connecting a router to a history object.

@param  {History} history
@return {Function}
Create a default handler for connecting a router to a history object .