UNPKG

riot

Version:

Simple and elegant component-based UI library

22 lines (17 loc) 665 B
/* Riot v10.1.2, @license MIT */ import { COMPONENTS_IMPLEMENTATION_MAP } from '../dependencies/@riotjs/util/constants.js'; import { panic } from '../dependencies/@riotjs/util/misc.js'; import cssManager from '../core/css-manager.js'; /** * Unregister a riot web component * @param {string} name - component name * @returns {Map} map containing all the components implementations */ function unregister(name) { if (!COMPONENTS_IMPLEMENTATION_MAP.has(name)) panic(`The component "${name}" was never registered`); COMPONENTS_IMPLEMENTATION_MAP.delete(name); cssManager.remove(name); return COMPONENTS_IMPLEMENTATION_MAP } export { unregister };