Browse Source

Add removeType method in DomComponents module

pull/2062/head
Artur Arseniev 7 years ago
parent
commit
e7fa93dd5e
  1. 14
      src/dom_components/index.js

14
src/dom_components/index.js

@ -623,6 +623,20 @@ module.exports = () => {
return;
},
/**
* Remove component type
* @param {string} type Component ID
* @returns {Object|undefined} Removed component type, undefined otherwise
*/
removeType(id) {
const df = componentTypes;
const type = this.getType(id);
if (!type) return;
const index = df.indexOf(type);
df.splice(index, 1);
return type;
},
/**
* Return the array of all types
* @return {Array}

Loading…
Cancel
Save