This is the base class with options from which some monster classes are derived.
This class is actually only used as a base class.
However, you can also create an instance directly via the monster namespace new Monster.Types.BaseWithOptions()
.
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
new Monster.Types.BaseWithOptions()
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/types/basewithoptions.js';
new BaseWithOptions()
</script>
Classes that require the possibility of options can be derived directly from this class.
Derived classes almost always override the defaul
getter with their own values.
class My extends BaseWithOptions {
get defaults() {
return Object.assign({}, super.defaults, {
mykey: true
});
}
}
The class was formerly called Object.