clean code
This commit is contained in:
parent
ffab44bfc3
commit
b8ffece105
1 changed files with 1 additions and 3 deletions
|
|
@ -26,9 +26,7 @@ export class TaskService implements OnDestroy {
|
|||
return onSnapshot(collection(this.firestore, 'tasks'), (list) => {
|
||||
this.allTasks = [];
|
||||
list.forEach((element) => {
|
||||
const taskData = element.data() as Task;
|
||||
const taskWithId = { ...taskData };
|
||||
taskWithId.id = element.id;
|
||||
const taskWithId = { id: element.id, ...element.data() } as Task;
|
||||
this.allTasks.push(taskWithId);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue