Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Cache

import { Cache } from "https://raw.githubusercontent.com/adamjosefus/allo_caching/main/mod.ts";
class Cache<T> {
has(key: string): boolean;
load<E extends LoadEntryType<T>>(...args: E): E extends LoadAndGenerateEntryType<T> ? T : T | undefined;
remove(key: string): void;
save(
key: string,
value: T,
dependencies?: DependenciesType,
): void;
}

§Type Parameters

§Methods

§
has(key: string): boolean
[src]

Check if value exists in cache.

@param key
@param value
§
load<E extends LoadEntryType<T>>(...args: E): E extends LoadAndGenerateEntryType<T> ? T : T | undefined
[src]
@return

<T> or <T> | undefined – depending on whether the generator has been set.

§
remove(key: string): void
[src]

Remove value from cache.

@param key
§
save(key: string, value: T, dependencies?: DependenciesType): void
[src]

Save value to cache by key.

@param key
@param value