todos-contra-el-fuego-web/imports/ui/components/Utils/location.js
2018-02-12 12:18:50 +01:00

21 lines
470 B
JavaScript

import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
export const location = new ReactiveVar();
export const currentLocation = () => {
if (Meteor.isClient) {
return window.location.pathname;
}
return location.get();
};
export const currentLocationHref = () => {
if (Meteor.isClient) {
return window.location.href;
}
// FIXME
return location.get();
};
export const isHome = () => currentLocation() === '/';