SuspenseCache

interface
react/src/hooks/suspense.ts:114

Backing store for the useSuspense* hooks.

Documented because suspenseCache exports an instance of it: a type reachable through a published value is part of the surface whether or not it was meant to be. Its internals stay private; what is documented is what a consumer can actually call.

Properties

NameTypeDescription
sizeget/setnumber

Methods

clear

signature
clear(): void

Returns

void

invalidate

signature
invalidate(key): void

Parameters

NameTypeDescription
keystring

Returns

void

read

signature
read<T>(key, load, staleTime, errorTtlMs): T

Type parameters

NameTypeDescription
T

Parameters

NameTypeDescription
keystring
NameTypeDescription
load() => T | Promise<T>
NameTypeDescription
staleTimenull | number
NameTypeDescription
errorTtlMsundefined | null | number

Returns

T