UNPKG

ghost-io

Version:

Invisible Background Data Fetching & Prefetching library that uses heuristics (hover, scroll, idle) to speed up your SPA or dashboard.

20 lines (17 loc) 465 B
export interface GhostIOConfig { maxCacheSize?: number; prefetchOnHover?: boolean; prefetchOnScroll?: boolean; idlePrefetchDelay?: number; concurrencyLimit?: number; } export interface AxiosIntegrationOptions { instance: any; } export declare class GhostIO { constructor(config?: GhostIOConfig); registerAxios(options: AxiosIntegrationOptions): void; prefetch(url: string): Promise<void>; get(url: string): any | null; clearCache(): void; }