import { R } from '../../common';
import { Router } from './Router';

/**
 * Navigates to the given path.
 */
export function push(path: string, res?: any) {
  if (res && R.is(Function, res.redirect)) {
    res.redirect(path);
  } else {
    Router.push(path);
  }
}
