Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cache<DataImmutable, DataMutable>

Provides a cache that allows more control over the formations. It automatically populates the skip option for the GraphQL query which prevents previously cached formations to be transmitted from the server

Type parameters

  • DataImmutable

  • DataMutable: DataImmutable

Hierarchy

  • Cache<DataImmutable, FormationWalkOptionsInit>
    • Cache

Implements

  • ICacheMutable<DataImmutable>
  • ReadonlyMap<string, IFormationImmutable<DataImmutable>>
  • ICacheMutable<DataImmutable>

Index

Constructors

constructor

  • new Cache(options: IOptions<DataImmutable, DataMutable>): Cache
  • Parameters

    • options: IOptions<DataImmutable, DataMutable>

    Returns Cache

Properties

limit

limit: number

provider

provider: IProvider<DataImmutable, FormationWalkOptionsInit>

size

size: number

Static limit

limit: number

Accessors

start

  • get start(): Promise<Guid>

Methods

__@iterator

  • __@iterator(): IterableIterator<[string, IFormationImmutable<DataImmutable>]>
  • Returns IterableIterator<[string, IFormationImmutable<DataImmutable>]>

__@toStringTag

  • __@toStringTag(): string
  • Returns string

clear

  • clear(): void
  • Returns void

entries

  • entries(): IterableIterator<[string, IFormationImmutable<DataImmutable>]>
  • Returns IterableIterator<[string, IFormationImmutable<DataImmutable>]>

fetch

  • fetch(id: GuidAccepted, options?: Options): Promise<IFormationImmutable<DataImmutable>>
  • Parameters

    • id: GuidAccepted
    • Optional options: Options

    Returns Promise<IFormationImmutable<DataImmutable>>

forEach

  • forEach(callback: function, thisArg: any): void
  • Parameters

    • callback: function
        • (value: IFormationImmutable<DataImmutable>, key: string, map: ReadonlyMap<string, IFormationImmutable<DataImmutable>>): void
        • Parameters

          • value: IFormationImmutable<DataImmutable>
          • key: string
          • map: ReadonlyMap<string, IFormationImmutable<DataImmutable>>

          Returns void

    • thisArg: any

    Returns void

get

  • get(id: GuidAccepted): IFormationImmutable<DataImmutable> | undefined
  • Parameters

    • id: GuidAccepted

    Returns IFormationImmutable<DataImmutable> | undefined

has

  • has(id: GuidAccepted): boolean
  • Parameters

    • id: GuidAccepted

    Returns boolean

keys

  • keys(): IterableIterator<string>
  • Returns IterableIterator<string>

Protected miss

  • miss(guid: Guid, options?: FormationWalkOptionsInit): AsyncIterableIterator<IFormationImmutable<DataImmutable>>
  • Parameters

    • guid: Guid
    • Default value options: FormationWalkOptionsInit = {}

    Returns AsyncIterableIterator<IFormationImmutable<DataImmutable>>

shrink

  • shrink(size: number): void
  • Parameters

    • size: number

    Returns void

Protected store

  • store(formation: IFormationImmutable<DataImmutable>): void
  • Parameters

    • formation: IFormationImmutable<DataImmutable>

    Returns void

toJSON

  • toJSON(_?: undefined | string): Array<string>
  • Parameters

    • Optional _: undefined | string

    Returns Array<string>

values

  • values(): IterableIterator<IFormationImmutable<DataImmutable>>
  • Returns IterableIterator<IFormationImmutable<DataImmutable>>