UNPKG

redux-first-router

Version:

think of your app in states not routes (and, yes, while keeping the address bar in sync)

18 lines (14 loc) 268 B
// @flow type Location = { pathname: string, search?: string } export default ({ pathname, search }: Location) => { if (search) { if (search.indexOf('?') !== 0) { search = `?${search}` } return `${pathname}${search}` } return pathname }