mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 21:52:08 +02:00
Could be turned into a createHistory enhancer function (https://github.com/rackt/history/blob/master/docs/Glossary.md#createhis toryenhancer), but we’ll see what the guys at rackt/history say about it…
18 lines
429 B
JavaScript
18 lines
429 B
JavaScript
'use strict';
|
|
|
|
import useBasename from 'history/lib/useBasename';
|
|
import createBrowserHistory from 'history/lib/createBrowserHistory';
|
|
import AppConstants from './constants/application_constants';
|
|
|
|
|
|
// Remove the trailing slash if present
|
|
const baseUrl = AppConstants.baseUrl.replace(/\/$/, '');
|
|
|
|
const history = useBasename(createBrowserHistory)({
|
|
basename: baseUrl
|
|
});
|
|
|
|
history.locationQueue = [];
|
|
|
|
export default history;
|