UNPKG

mylingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

30 lines 958 B
import Appendable from "../api/core/Appendable"; import { setupDefaults, setupSchema } from "../interface/ISetup"; import { pullSetupStack, pushSetupStack, refreshSetupStack } from "../states/useSetupStack"; class Setup extends Appendable { noEffect; static componentName = "setup"; static defaults = setupDefaults; static schema = setupSchema; data = {}; constructor(noEffect) { super(); this.noEffect = noEffect; if (noEffect) return; pushSetupStack(this.data); this.then(() => pullSetupStack(this.data)); } } for (const key of Object.keys(setupSchema)) Object.defineProperty(Setup.prototype, key, { get() { return this.data[key]; }, set(value) { this.data[key] = value; !this.noEffect && refreshSetupStack(); } }); export default Setup; //# sourceMappingURL=Setup.js.map