Skip to main content
Version: 2.x.x

getCacheEvents


import { getCacheEvents } from "@hyper-fetch/core"

Description

Defined in cache/cache.events.ts:6

Preview

getCacheEvents(emitter)

Parameters

NameDetails

emitter

Required

EventEmitter

Returns

{
emitCacheData: (cacheKey: string, data: CacheValueType<Response, Error>) => void;
emitRevalidation: (cacheKey: string) => void;
onData: (cacheKey: string, callback: (data: CacheValueType<Response, Error>) => void) => VoidFunction;
onRevalidate: (cacheKey: string, callback: () => void) => VoidFunction;
}