{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/history/issues/188","labels_url":"https://api.github.com/repos/rackt/history/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/rackt/history/issues/188/comments","events_url":"https://api.github.com/repos/rackt/history/issues/188/events","html_url":"https://github.com/rackt/history/issues/188","id":121983213,"number":188,"title":"Can not change basename after initialization. (with useBasename)","user":{"login":"ironhee","id":4298791,"avatar_url":"https://avatars.githubusercontent.com/u/4298791?v=3","gravatar_id":"","url":"https://api.github.com/users/ironhee","html_url":"https://github.com/ironhee","followers_url":"https://api.github.com/users/ironhee/followers","following_url":"https://api.github.com/users/ironhee/following{/other_user}","gists_url":"https://api.github.com/users/ironhee/gists{/gist_id}","starred_url":"https://api.github.com/users/ironhee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironhee/subscriptions","organizations_url":"https://api.github.com/users/ironhee/orgs","repos_url":"https://api.github.com/users/ironhee/repos","events_url":"https://api.github.com/users/ironhee/events{/privacy}","received_events_url":"https://api.github.com/users/ironhee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-14T06:34:20Z","updated_at":"2016-01-04T22:25:58Z","closed_at":null,"body":"History object can not change it's basename after initialization.  (with [useBasename](https://github.com/rackt/history/blob/master/modules/useBasename.js))\r\n\r\nCurrently, I change basename with reloading location.\r\n\r\n```javascript\r\nimport createBrowserHistory from 'history/lib/createBrowserHistory';\r\n\r\nfunction getBasePath() {\r\n  const $base = document.getElementsByTagName('base')[0];\r\n  if ($base) {\r\n    return $base.getAttribute('href');\r\n  }\r\n  return '';\r\n}\r\n\r\nfunction setBasePath(basePath) {\r\n  const pathname = document.location.pathname.slice(getBasePath().length);\r\n\r\n  const $base = document.getElementsByTagName('base')[0];\r\n  if ($base) {\r\n    $base.setAttribute('href', basePath);\r\n  }\r\n\r\n  createBrowserHistory()\r\n    .push(urlJoin(basePath, pathname));\r\n  window.location.reload();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/rackt/history/issues/comments/168830426","html_url":"https://github.com/rackt/history/issues/188#issuecomment-168830426","issue_url":"https://api.github.com/repos/rackt/history/issues/188","id":168830426,"user":{"login":"mjackson","id":92839,"avatar_url":"https://avatars.githubusercontent.com/u/92839?v=3","gravatar_id":"","url":"https://api.github.com/users/mjackson","html_url":"https://github.com/mjackson","followers_url":"https://api.github.com/users/mjackson/followers","following_url":"https://api.github.com/users/mjackson/following{/other_user}","gists_url":"https://api.github.com/users/mjackson/gists{/gist_id}","starred_url":"https://api.github.com/users/mjackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjackson/subscriptions","organizations_url":"https://api.github.com/users/mjackson/orgs","repos_url":"https://api.github.com/users/mjackson/repos","events_url":"https://api.github.com/users/mjackson/events{/privacy}","received_events_url":"https://api.github.com/users/mjackson/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T22:25:58Z","updated_at":"2016-01-04T22:25:58Z","body":"This isn't something we can support with our current architecture. Currently, `history` objects are used to both:\r\n\r\n- listen for changes to the current `location` and\r\n- create `href` attributes for `<a>"}}