Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SuperCache

Class SuperCache.

Hierarchy

  • SuperCache

Index

Constructors

constructor

  • new SuperCache(__namedParameters?: { adapterOptions: any; extra: any; log: any; storage: {} }): SuperCache
  • Create an instance of SuperCache

    Parameters

    • Default value __namedParameters: { adapterOptions: any; extra: any; log: any; storage: {} } = {}
      • adapterOptions: any
      • extra: any
      • log: any
      • storage: {}

    Returns SuperCache

Methods

addAdapter

  • addAdapter(key: string, adapter: any): void
  • Add adapter

    Parameters

    • key: string
    • adapter: any

      如果是 object,参数看下面,如果是function,则会变成 adapter.data = adapter

    Returns void

get

  • get(key: string, options?: {}): Promise<any>
  • Get value

    async

    Parameters

    • key: string

      需要获取数据的 key

    • Default value options: {} = {}

    Returns Promise<any>

    返回一个 Promise 对象,该对象返回需要获取的数据

getAdapter

  • getAdapter(key: string): any
  • Get adapter by key

    Parameters

    • key: string

    Returns any

    返回 adapter 对象

getAdapterValue

  • getAdapterValue(key: string): Promise<any>
  • Get value by adapter

    async

    Parameters

    • key: string

      需要获取数据的 key

    Returns Promise<any>

    返回一个 Promise 对象,该对象返回需要获取的数据

getAndUpdateAdapterValue

  • getAndUpdateAdapterValue(key: string, __namedParameters: { updateCache: boolean }): Promise<any>
  • Get and Update value by adapter

    async

    Parameters

    • key: string

      需要获取数据的 key

    • __namedParameters: { updateCache: boolean }
      • updateCache: boolean

    Returns Promise<any>

    返回一个 Promise 对象,该对象返回需要获取的数据

remove

  • remove(key: string): any

set

  • set(key: string, value: any): any
  • Set value

    Parameters

    • key: string

      需要获取数据的 key

    • value: any

      storage.remove 的返回结果

    Returns any

Generated using TypeDoc