mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-14 05:36:45 +03:00
20 lines
468 B
JavaScript
20 lines
468 B
JavaScript
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
|
|
});
|
|
}
|
|
}
|