tsbase
    Preparing search index...

    Interface ICache<T>

    An abstraction for prioritizing performance over data "freshness"

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

    Type Parameters

    • T

    Implemented by

    Index

    Methods

    Methods

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

      Parameters

      • key: string
      • Optionaltype: new () => T

      Returns null | T