Event:
| {
age: number;
key: string;
state: "fresh"
| "stale"
| "retained";
type: "hit";
}
| { key: string; type: "miss" }
| { key: string; retainFor: number; type: "write" }
| { key: string; type: "skip" }
| { key: string; ok: boolean; type: "refresh" }
| { age: number; key: string; type: "served-stale" }
| {
background: boolean;
error: unknown;
key: string;
type: "action-error";
}
| {
error: unknown;
key: string;
operation: "get"
| "set"
| "delete"
| "clear";
type: "store-error";
}
Type Declaration
- { age: number; key: string; state: "fresh" | "stale" | "retained"; type: "hit" }
- { key: string; type: "miss" }
- { key: string; retainFor: number; type: "write" }
- { key: string; type: "skip" }
- { key: string; ok: boolean; type: "refresh" }
- { age: number; key: string; type: "served-stale" }
- { background: boolean; error: unknown; key: string; type: "action-error" }
- {
error: unknown;
key: string;
operation: "get" | "set" | "delete" | "clear";
type: "store-error";
}
Everything observable. Reported, never thrown.
action-errorandstore-errorcarry what went wrong; the rest are facts about what the cache did, so a listener counts them without unpacking an error it does not need.