export class LayoutFormConfig {
  constructor() {
    this._config = null;
    this.listeners = [];
  }
  static getInstance() {
    if (!LayoutFormConfig.instance) {
      LayoutFormConfig.instance = new LayoutFormConfig();
    }
    return LayoutFormConfig.instance;
  }
  get config() {
    return this._config;
  }
  setConfig(newConfig) {
    this._config = newConfig;
    this.notifyListeners();
  }
  onConfigChange(listener) {
    this.listeners.push(listener);
  }
  notifyListeners() {
    this.listeners.forEach(listener => listener(this._config));
  }
}
