Skip to content

Instantly share code, notes, and snippets.

@Garvice
Last active April 15, 2017 18:41
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 Garvice/34bd0d1483becd5c15435d83a28231fc to your computer and use it in GitHub Desktop.
Save Garvice/34bd0d1483becd5c15435d83a28231fc to your computer and use it in GitHub Desktop.
const TASK_NAME_COLUMN_ID: number = 123456789;
const DONE_COLUMN_ID: number = 123456789;
private extractTodos(rows: Array<any>): Array<Todo> {
const todos = new Array<Todo>();
rows.forEach(row => {
let todo = new Todo(row.id);
row.cells.forEach(cell => {
switch (cell.columnId) {
case TASK_NAME_COLUMN_ID:
todo.name = cell.value;
break;
case DONE_COLUMN_ID:
todo.completed = cell.value;
break;
}
});
todos.push(todo);
});
return todos;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment