( history: History, root: string, useHash: boolean, segments: string[], direction: RouterDirection, state: number, queryString?: string, fragment?: string )
| 23 | }; |
| 24 | |
| 25 | export const writeSegments = ( |
| 26 | history: History, |
| 27 | root: string, |
| 28 | useHash: boolean, |
| 29 | segments: string[], |
| 30 | direction: RouterDirection, |
| 31 | state: number, |
| 32 | queryString?: string, |
| 33 | fragment?: string |
| 34 | ) => { |
| 35 | const url = generateUrl([...parsePath(root).segments, ...segments], useHash, queryString, fragment); |
| 36 | if (direction === ROUTER_INTENT_FORWARD) { |
| 37 | history.pushState(state, '', url); |
| 38 | } else { |
| 39 | history.replaceState(state, '', url); |
| 40 | } |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * Transforms a chain to a list of segments. |
no test coverage detected