2

I have a simple Model with observable id id

class TodoStore {
  todos = [];
  id: generateId();


  get completedTodosCount() {
    return this.todos.filter(
      todo => todo.completed === true
    ).length;
  }
}

const todoStore = new TodoStore();
                    

now I want to add a feature to clone this todo just by duplicate this exact model with new generated id with it's todos and any extra infos.

How to do that? .toJS and .createViewModel doesn't work!

MMJ
  • 279
  • 7
  • 23

0 Answers0