13 lines
321 B
JavaScript
13 lines
321 B
JavaScript
|
/**
|
||
|
* 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;
|