Skip to content

Latest commit

 

History

History
217 lines (109 loc) · 3.83 KB

File metadata and controls

217 lines (109 loc) · 3.83 KB

bandcamp-fetchDocs


bandcamp-fetch / Cache

Class: Cache

Constructors

new Cache()

new Cache(ttl, maxEntries): Cache

Parameters

ttl: Record<CacheDataType, number>

maxEntries: Record<string, number>

Returns

Cache

Defined in

lib/utils/Cache.ts:13

Methods

clear()

clear(type?): void

Parameters

type?: CacheDataType

Returns

void

Defined in

lib/utils/Cache.ts:76


get()

get<T>(type, key): undefined | T

Type Parameters

T

Parameters

type: CacheDataType

key: string

Returns

undefined | T

Defined in

lib/utils/Cache.ts:40


getKeys()

getKeys(type): string[]

Parameters

type: CacheDataType

Returns

string[]

Defined in

lib/utils/Cache.ts:72


getMaxEntries()

getMaxEntries(type): number

Parameters

type: CacheDataType

Returns

number

Defined in

lib/utils/Cache.ts:35


getOrSet()

getOrSet<T>(type, key, promiseCallback): Promise<T>

Type Parameters

T

Parameters

type: CacheDataType

key: string

promiseCallback

Returns

Promise<T>

Defined in

lib/utils/Cache.ts:87


put()

put<T>(type, key, value): boolean

Type Parameters

T

Parameters

type: CacheDataType

key: string

value: T

Returns

boolean

Defined in

lib/utils/Cache.ts:45


reduceEntries()

reduceEntries(type, reduceTo?): void

Parameters

type: CacheDataType

reduceTo?: number

Returns

void

Defined in

lib/utils/Cache.ts:60


setMaxEntries()

setMaxEntries(type, maxEntries): void

Parameters

type: CacheDataType

maxEntries: number

Returns

void

Defined in

lib/utils/Cache.ts:30


setTTL()

setTTL(type, ttl): void

Parameters

type: CacheDataType

ttl: number

Returns

void

Defined in

lib/utils/Cache.ts:21