Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ListNodeV2Cache

Caches list nodes obtained from Knora. As an optimization, the whole list is requested and cached (all of its nodes) once a list node has been rquested.

Hierarchy

Index

Constructors

constructor

Methods

Protected getDependenciesOfItem

  • getDependenciesOfItem(item: ListNodeV2): string[]

Protected getItem

  • getItem(key: string, isDependency?: boolean): AsyncSubject<ListNodeV2>
  • Gets a specific item from the cache. If not cached yet, the information will be fetched from Knora.

    Parameters

    • key: string

      the id of the item to be returned.

    • Default value isDependency: boolean = false

      true if the item to be returned is a dependency of another item (recursive call to this method).

    Returns AsyncSubject<ListNodeV2>

    the requested item.

Protected getKeyOfItem

getNode

  • getNode(nodeIri: string): AsyncSubject<ListNodeV2>
  • Given a list node IRI, gets it from the cache.

    The root node of a list should not be requested using this method. This should be left to dependency handling to optimize caching.

    Parameters

    • nodeIri: string

      the IRI of the list node to be returned.

    Returns AsyncSubject<ListNodeV2>

Protected reloadItem

  • reloadItem(key: string): AsyncSubject<ListNodeV2>

Protected requestItemFromKnora

  • requestItemFromKnora(key: string, isDependency: boolean): Observable<ListNodeV2[]>

Generated using TypeDoc