This sort of thing works in JavaScript
function main() {
return 1;
}
main.sub = function () {
return 2;
};
main(); // 1
main.sub(); // 2
and seems useful for doing stuff like
function props() {
return { color: props.color(), size: props.size() };
}
props.color = function () {
// calculate and return color
};
props.size = function () {
// calculate and return size
};
so that you'd have an easy way to pull in an object of all the props using prop()
but if you only need one you can call for it directly. Is that type of setup okay?