redux-first-router
Version:
think of your app in states not routes (and, yes, while keeping the address bar in sync)
16 lines (10 loc) • 381 B
JavaScript
export default (function (doc, title) {
if (typeof title === 'string' && doc.title !== title) {
return doc.title = title;
}
return null;
});
export var getDocument = function getDocument() {
var isSSRTest = process.env.NODE_ENV === 'test' && typeof window !== 'undefined' && window.isSSR;
return typeof document !== 'undefined' && !isSSRTest ? document : {};
};