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) => {
|
return onSnapshot(collection(this.firestore, 'tasks'), (list) => {
|
||||||
this.allTasks = [];
|
this.allTasks = [];
|
||||||
list.forEach((element) => {
|
list.forEach((element) => {
|
||||||
const taskData = element.data() as Task;
|
const taskWithId = { id: element.id, ...element.data() } as Task;
|
||||||
const taskWithId = { ...taskData };
|
|
||||||
taskWithId.id = element.id;
|
|
||||||
this.allTasks.push(taskWithId);
|
this.allTasks.push(taskWithId);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue