interface NavigateArgs { to : string ; delay ? : number ; } /**
 * Trigger a page navigation
 */ const navigateRunner = ( dispatch , { to , delay = 0 } ) => { dispatchEvent ( new CustomEvent ( "navigationstart" ) ) ; setTimeout ( ( ) => { if ( to . startsWith ( '/' ) ) { history . pushState ( null , '' , to ) ; dispatchEvent ( new CustomEvent ( "pushstate" ) ) ; } else { window . location . href = to ; } } , delay ) ; } ; const navigate = ( args ) => [ navigateRunner , args ] ; export default navigate ;