/** * Changes the document's title * @param {string} title * @param {string} mainTitle * @returns */ export const changeTitle = (title, mainTitle = changeTitle.title) => document && (document.title = `${title} | ${mainTitle}`); changeTitle.title = (document && document.title) || ""; export default changeTitle;