MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / register

Function register

src/controller/factory.js:85–91  ·  view source on GitHub ↗

* Register controllers * @param {String} type - The type of the connecting UI component * @param {Class} contrConstructor * @param {Array } allowedSecondaryTypes - UI components that are allowed to connect to the defined controller * @return {Object} A controller instance

(type, contrConstructor, allowedSecondaryTypes)

Source from the content-addressed store, hash-verified

83 * @return {Object} A controller instance
84 */
85function register(type, contrConstructor, allowedSecondaryTypes) {
86 if (repo.has(type)) {
87 throw new Error('Subcontroller class already registered.');
88 } else {
89 repo.set(type, {contrConstructor, allowedSecondaryTypes});
90 }
91}
92
93function registerPeer(type, contrConstructor) {
94 if (peerRepo.has(type)) {

Callers 1

initFactoryFunction · 0.70

Calls 2

hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected