Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
feat: save reads on calendar tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Yudi committed Sep 26, 2024
1 parent 2bc8004 commit 7eef4ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { startOfDay, startOfWeek, sub } from 'date-fns';

import { ToastController } from '@ionic/angular/standalone';
import { AngularFirestore } from '@angular/fire/compat/firestore';
import { switchMap } from 'rxjs/operators';
import { shareReplay, switchMap, take } from 'rxjs/operators';
import { AsyncPipe, formatDate, KeyValuePipe } from '@angular/common';

import { EventItem } from 'src/app/shared/services/event';
Expand Down Expand Up @@ -92,7 +92,7 @@ export class CalendarListViewComponent implements OnInit, OnChanges {
return query.orderBy('eventStartDate', 'asc');
})
.valueChanges({ idField: 'id' })
.pipe(trace('firestore'));
.pipe(trace('firestore'), take(1), shareReplay(1));
}),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CoursesService } from 'src/app/shared/services/courses.service';
import { startOfDay, endOfDay } from 'date-fns';

import { AngularFirestore } from '@angular/fire/compat/firestore';
import { switchMap } from 'rxjs/operators';
import { shareReplay, switchMap, take } from 'rxjs/operators';

import { EventItem } from 'src/app/shared/services/event';
import { trace } from '@angular/fire/compat/performance';
Expand Down Expand Up @@ -70,7 +70,7 @@ export class ItemListViewComponent implements OnInit, OnChanges {
return query.orderBy('eventStartDate', 'asc');
})
.valueChanges({ idField: 'id' })
.pipe(trace('firestore'));
.pipe(trace('firestore'), take(1), shareReplay(1));
}),
);
}
Expand Down

0 comments on commit 7eef4ff

Please sign in to comment.