Closed
Description
In the Routing with vue-router chapter the first example looks like this:
const history = isServer ? createMemoryHistory() : createWebHistory()
const routes = [{ path: '/user', component: MyUser }]
export default function() {
return createRouter({ routes, history })
}
The code exports router factory which creates new router instance every time. But all instances created by this factory share the same instance of history. Assuming the history created by createMemoryHistory()
is stateful, isn't it wrong (Avoid Stateful Singletons) ?
Metadata
Metadata
Assignees
Labels
No labels