Interface ICache<T>

An abstraction for prioritizing performance over data "freshness"

interface ICache<T> {
    Add(key, value): Result<null>;
    Delete(key): Result<null>;
    Get(key, type?): null | T;
}

Type Parameters

  • T

Implemented by

Methods

Methods

  • Get the value cached at the given key | returns null when there is no value for the given key

    Parameters

    • key: string
    • Optional type: (new () => T)
        • new (): T
        • Returns T

    Returns null | T

Generated using TypeDoc