tickle/modules/changeTitle.mjs

13 lines
321 B
JavaScript
Raw Normal View History

/**
* 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;