finally saving things

This commit is contained in:
muerwre 2018-08-30 17:10:33 +07:00
parent e0f5d0238a
commit 47e4f4a97d
22 changed files with 277 additions and 38 deletions

View file

@ -1,12 +1,13 @@
export const getPath = () => (window.location && window.location.pathname &&
window.location.pathname.replace(/^\//, ''));
export const replacePath = url => window.history.replaceState(url, 'Редактирование маршрута', url);
export const pushPath = url => window.history.pushState(url, 'Редактирование маршрута', url);
export const getUrlData = () => {
const url = getPath();
const [path, mode] = url.split('/');
const { host } = window.location;
return { path, mode };
return { path, mode, host };
};