export class ToDoData {
  constructor(text: string, done: boolean = false) {
    this._object = { text: text, done: done };
    this._key = "";
    this.updateKey();
  }
  get text() {
    return this._object.text;
  }
  get done() {
    return this._object.done;
  }
  get key() {
    return this._key;
  }

  private updateKey() {
    this._key = Math.random().toString(32).substring(2);
  }

  private _key: string;
  private _object: { text: string; done: boolean };
}