Added size getter for cache
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/utils",
|
"name": "@ztimson/utils",
|
||||||
"version": "0.30.0",
|
"version": "0.30.1",
|
||||||
"description": "Utility library",
|
"description": "Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ export class Cache<K extends string | number | symbol, T> {
|
|||||||
/** Await initial loading */
|
/** Await initial loading */
|
||||||
loading = new Promise<void>(r => this._loading = r);
|
loading = new Promise<void>(r => this._loading = r);
|
||||||
|
|
||||||
|
get size() { return this.store.size; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new cache
|
* Create new cache
|
||||||
* @param {keyof T} key Default property to use as primary key
|
* @param {keyof T} key Default property to use as primary key
|
||||||
|
|||||||
Reference in New Issue
Block a user