"use strict"; // I M P O R T import html from "choo/html"; // U T I L S import config from "@root/config"; let title = ""; // E X P O R T export default (state, emit) => { switch(true) { case (state.route !== "/" && state.params.wildcard): title = `${state.params.wildcard.capitalize()} ∙ LBRY ∙ ${config.meta.tagline}`; break; case (state.route === "api"): title = `API ∙ LBRY ∙ ${config.meta.tagline}`; break; default: title = `LBRY ∙ ${config.meta.tagline}`; break; } if (state.title !== title) emit(state.events.DOMTITLECHANGE, title); state.page = state.page || { }; const newMetadata = state.lbry; return html`