* 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)
| 83 | * @return {Object} A controller instance |
| 84 | */ |
| 85 | function 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 | |
| 93 | function registerPeer(type, contrConstructor) { |
| 94 | if (peerRepo.has(type)) { |
no test coverage detected