1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/history.js

19 lines
490 B
JavaScript
Raw Normal View History

'use strict';
2015-10-13 14:19:08 +02:00
import useBasename from 'history/lib/useBasename';
2016-01-05 17:27:35 +01:00
import useQueries from 'history/lib/useQueries';
import createBrowserHistory from 'history/lib/createBrowserHistory';
2015-10-13 14:19:08 +02:00
import AppConstants from './constants/application_constants';
2015-10-13 14:19:08 +02:00
// Remove the trailing slash if present
const baseUrl = AppConstants.baseUrl.replace(/\/$/, '');
2015-10-13 14:19:08 +02:00
2016-02-01 10:18:30 +01:00
const history = useBasename(useQueries(createBrowserHistory))({
2015-10-13 14:19:08 +02:00
basename: baseUrl
});
history.locationQueue = [];
export default history;