graphene/docs/app.js

20 lines
468 B
JavaScript
Raw Normal View History

2015-11-21 21:33:29 +03:00
exports.loadContext = function(callback) {
var context;
context = require.context('./pages', true);
if (module.hot) {
module.hot.accept(context.id, function() {
context = require.context('./pages', true);
return callback(context);
});
}
return callback(context);
};
exports.onRouteChange = function(state) {
if (typeof window !== "undefined" && window.ga) {
window.ga('send', 'pageview', {
page: state.pathname
});
}
}