Sha256: 3ddb5bd6516ec6d029cf2a49820684b2cf2bf7282c9d6e388aba6fdd3e861e35

Contents?: true

Size: 509 Bytes

Versions: 15

Compression:

Stored size: 509 Bytes

Contents

import { Box } from "./box";

export class Component {
  id: string;
  _state: any;
  _errors: any[];
  _root: Box;

  constructor(state: any = {}, id: string = Math.random().toString(36).substring(2, 10), errors: any[] = []) {
    this._state = state;
    this.id = id;
    this._errors = errors;
    this._root = new Box({ data: { component: this.constructor.name, state: JSON.stringify(this._state), id: this.id, errors: this._errors } });
  }

  get render(): string {
    return this._root.render;
  }
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
clapton-0.0.15 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.14 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.13 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.12 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.11 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.10 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.9 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.8 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.7 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.6 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.5 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.4 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.3 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.2 lib/clapton/javascripts/src/components/component.ts
clapton-0.0.1 lib/clapton/javascripts/src/components/component.ts