Class FeedCache<TCached>Abstract

Dexie backed generic hookable store

Type Parameters

  • TCached

Hierarchy

Constructors

Properties

#hits: number = 0
#miss: number = 0
#snapshot: TCached[] = []
cache: Map<string, TCached> = ...
log: Debugger
name: string
onTable: Set<string> = ...
prefixed: string | boolean

Methods

  • Type Parameters

    • T extends "change"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Loads a list of rows from disk cache

    Parameters

    • keys: string[]

      List of ids to load

    Returns Promise<string[]>

    Keys that do not exist on disk cache

  • Parameters

    • keys: string[]

    Returns Promise<TCached[]>

  • Parameters

    Returns Promise<void>

  • Returns Promise<void>

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends "change"

    Parameters

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns "change"[]

  • Parameters

    • Optional key: string

    Returns Promise<undefined | TCached>

  • Parameters

    • Optional key: string

    Returns undefined | TCached

  • Parameters

    Returns string

  • Returns string[]

  • Return the number of listeners listening to a given event.

    Parameters

    • event: "change"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "change"

    Parameters

    • event: T

    Returns ((...args) => void)[]

  • Type Parameters

    • T extends "change"

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends "change"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends "change"

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any

    Returns this

  • Returns Promise<void>

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: "change"

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "change"

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

  • Parameters

    Returns Promise<void>

  • Returns TCached[]

  • Returns TCached[]

  • Try to update an entry where created values exists

    Type Parameters

    • TCachedWithCreated extends {
          created: number;
          loaded: number;
      }

    Parameters

    Returns Promise<"new" | "updated" | "refresh" | "no_change">

Generated using TypeDoc