This commit is contained in:
sdarbinyan
2026-03-06 18:40:58 +04:00
parent c3e4e695eb
commit 0b3b2ee463
25 changed files with 253 additions and 165 deletions

View File

@@ -0,0 +1,15 @@
import { Injectable } from '@angular/core';
import { ApiService } from './api.service';
@Injectable({ providedIn: 'root' })
export class PrefetchService {
private prefetched = new Set<number>();
constructor(private api: ApiService) {}
prefetchItem(itemID: number): void {
if (this.prefetched.has(itemID)) return;
this.prefetched.add(itemID);
this.api.getItem(itemID).subscribe();
}
}