File

libs/core/src/lib/model/internal/id-cache.ts

Index

Properties
Methods

Properties

Private cache
Type : Map<string | T>
Default value : new Map()

Methods

Public get
get(id: string)
Parameters :
Name Type Optional
id string No
Returns : T
Public has
has(id: string)
Parameters :
Name Type Optional
id string No
Returns : boolean
Public set
set(id: string, value: T)
Parameters :
Name Type Optional
id string No
value T No
Returns : void
export class IdCache<T> {

    private cache: Map<string, T> = new Map();

    public has(id: string): boolean {
        return this.cache.has(id);
    }

    public get(id: string): T {
        return this.cache.get(id);
    }

    public set(id: string, value: T) {
        this.cache.set(id, value);
    }

}

result-matching ""

    No results matching ""