1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 08:37:59 +02:00
onion/js/history.js
Brett Sun fce578e854 Decorate rackt/history with history of previous locations
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…
2016-01-08 11:44:25 +01:00

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;