Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mr21
Created March 8, 2019 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mr21/05a57dc90a39b0844715435ac1df2493 to your computer and use it in GitHub Desktop.
Save mr21/05a57dc90a39b0844715435ac1df2493 to your computer and use it in GitHub Desktop.
// create the new TodoMVC instance:
// ................................................................
const todomvc2 = new TodoMVC();
document.body.append( todomvc2.rootElement );
// move the first todo from the first todomvc to the second one
// ................................................................
const firstTodoId = Object.keys( todomvc.data )[ 0 ],
firstTodo = todomvc.data[ firstTodoId ];
delete todomvc.data[ firstTodoId ];
todomvc2.data[ firstTodoId ] = firstTodo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment