19 lines
583 B
JavaScript
19 lines
583 B
JavaScript
const HCMagicHome = require("./HCMagicHome");
|
|
const HCMagicHomeAddressable = require("./HCMagicHomeAddressable");
|
|
const HCMHAddressableSubsection = require("./HCMHAddressableSubsection");
|
|
|
|
const MagicHomeRegistry = {};
|
|
|
|
function proxy(opts) {
|
|
switch(opts.type) {
|
|
case "addressable":
|
|
return new HCMagicHomeAddressable(opts, MagicHomeRegistry);
|
|
case "subsection":
|
|
return new HCMHAddressableSubsection(opts, MagicHomeRegistry);
|
|
case "normal":
|
|
default:
|
|
return new HCMagicHome(opts);
|
|
}
|
|
}
|
|
|
|
module.exports = proxy; |