UNPKG

@hyperapp/router

Version:

Declarative routing for Hyperapp V1 using the History API.

7 lines (6 loc) 182 B
export function Redirect(props) { return function(state, actions) { var location = state.location history.replaceState(props.from || location.pathname, "", props.to) } }