@cacheable/utils
Advanced tools
+5
-0
@@ -155,2 +155,7 @@ /** | ||
| throwErrors?: boolean | GetOrSetThrowErrorsContext; | ||
| /** | ||
| * If set, this will bypass the instances nonBlocking setting for the get call. | ||
| * @type {boolean} | ||
| */ | ||
| nonBlocking?: boolean; | ||
| }; | ||
@@ -157,0 +162,0 @@ type GetOrSetOptions = GetOrSetFunctionOptions & { |
+5
-0
@@ -155,2 +155,7 @@ /** | ||
| throwErrors?: boolean | GetOrSetThrowErrorsContext; | ||
| /** | ||
| * If set, this will bypass the instances nonBlocking setting for the get call. | ||
| * @type {boolean} | ||
| */ | ||
| nonBlocking?: boolean; | ||
| }; | ||
@@ -157,0 +162,0 @@ type GetOrSetOptions = GetOrSetFunctionOptions & { |
+5
-6
| { | ||
| "name": "@cacheable/utils", | ||
| "version": "2.3.4", | ||
| "version": "2.4.0", | ||
| "description": "Cacheable Utilities for Caching Libraries", | ||
@@ -30,10 +30,9 @@ "type": "module", | ||
| "dependencies": { | ||
| "hashery": "^1.3.0", | ||
| "hashery": "^1.5.0", | ||
| "keyv": "^5.6.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@faker-js/faker": "^10.2.0", | ||
| "@types/node": "^24.10.10", | ||
| "lru-cache": "^11.2.4", | ||
| "rimraf": "^6.1.2", | ||
| "@faker-js/faker": "^10.3.0", | ||
| "@types/node": "^25.3.0", | ||
| "rimraf": "^6.1.3", | ||
| "tsup": "^8.5.1", | ||
@@ -40,0 +39,0 @@ "typescript": "^5.9.3" |
+4
-1
@@ -5,3 +5,3 @@ [<img align="center" src="https://cacheable.org/logo.svg" alt="Cacheable" />](https://github.com/jaredwray/cacheable) | ||
| [](https://codecov.io/gh/jaredwray/cacheable) | ||
| [](https://codecov.io/gh/jaredwray/cacheable) | ||
| [](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml) | ||
@@ -484,5 +484,8 @@ [](https://www.npmjs.com/package/@cacheable/utils) | ||
| throwErrors?: boolean; | ||
| nonBlocking?: boolean; | ||
| }; | ||
| ``` | ||
| The `nonBlocking` option allows you to override the instance-level `nonBlocking` setting for the `get` call within `getOrSet`. When set to `false`, the `get` will block and wait for a response from the secondary store before deciding whether to call the provided function. When set to `true`, the primary store returns immediately and syncs from secondary in the background. | ||
| Here is an example of how to use the `getOrSet` method: | ||
@@ -489,0 +492,0 @@ |
78014
0.88%5
-16.67%1582
0.32%521
0.58%Updated