Class MemoryCacheAdapter<TType>

To utilize the MemoryCacheAdapter, you must create instance of it.

import { MemoryCacheAdapter } from "@daiso-tech/core";

const cacheAdapter = new MemoryCacheAdapter(client);

You can also provide an Map.

import { MemoryCacheAdapter } from "@daiso-tech/core";

const map = new Map<any, any>();
const cacheAdapter = new MemoryCacheAdapter("@cache", map);

Type Parameters

  • TType

Implements

Constructors

Methods

  • The put method replaces a key if the key exists including the ttl value or adds key that do not exists with a given ttl. Returns true if the key where replaced otherwise false is returned. You must provide a ttl value. If null is passed, the item will not expire.

    Parameters

    Returns Promise<boolean>