Static properties are properties attached to the stamp itself.
constPrintMyself=stampit({ statics: { myProperty:'foo',printMyself() {console.log(this) } }})PrintMyself.myProperty ==='foo'PrintMyself.printMyself() // call the function without creating an instance of the stamp
If you compose the stamp above with any other stamp, then it will have the printMyself method too.
The example above exposes a static function which controls access to the setFactor method of your object instances.
HasFactor().setFactor ===undefined// there is no .setFactor() methodconstHasFactorAllowed=HasFactor.allowFactorSetter(true)constinstance=HasFactor2()instance.setFactor(5); // we have access to the setter!instance.getFactor() ===5// the factor was set
Descriptor merging algorithm
The static properties are copied by assignment. In other words - by reference using Object.assign.