UNPKG

hta

Version:

The tiny framework for building Hyper Text Application with ease

8 lines (6 loc) 241 B
import history from "./history"; export default function redirectTo(to, state, replace) { if (history.location.pathname === to) return; // console.log("redirect", to); replace ? history.replace(to, state) : history.push(to, state); }