import { Construct, ofConstruct } from '../types/Constructor'; export class State { constructor(protected readonly state: any = {}) {} protected get = (key: string, alt?: Construct): T => this.state[key] ?? (this.state[key] = ofConstruct(alt)); protected set = (key: string, value: Construct): T => this.get(key, value); }