@blaze-cache/fetch 0.2.1-beta → 0.2.3-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,6 +86,17 @@ window.fetch = fetch; // now every request in the app is cache
|
|
|
86
86
|
and the `shouldCache` callback are all guarded: the first cache-layer failure is
|
|
87
87
|
announced once on the console, then the wrapper keeps working *without* the cache rather
|
|
88
88
|
than warning on every call.
|
|
89
|
+
* **Cache activity is observable** — the wrapper reads with `cache.get` and writes with
|
|
90
|
+
`cache.set`, so the shared cache's typed event system sees every request it serves:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
cache.on('hit', ({ key }) => console.log('replayed', key));
|
|
94
|
+
cache.on('miss', ({ key }) => console.log('fetched', key));
|
|
95
|
+
cache.on('evict', ({ key }) => console.log('dropped', key));
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`on` returns its own unsubscribe function; the full event table is in the
|
|
99
|
+
[repository README](https://github.com/blaze-cache/blaze-cache#events).
|
|
89
100
|
|
|
90
101
|
## Options
|
|
91
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cache/fetch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3-beta",
|
|
4
4
|
"description": "Drop-in fetch() replacement backed by a WebAssembly cache — TTLs, Cache-Control, stale-while-revalidate and an x-blaze-cache HIT/MISS marker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@blaze-cache/core": "0.2.
|
|
41
|
+
"@blaze-cache/core": "0.2.3-beta"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"typescript": "^5.9.3"
|