You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _Delayed_ component uses _usePromiseSuspensible_ hook to call a promise that resolves with an array of number or reject: if promise has been resolved, array number is rendered with a button to invalidate result, otherwise an alert is invocked. Delayed component is returned from _UsePromiseSuspensible_ component.
6
+
The _Delayed_ component uses _usePromise_ hook to call a promise that resolves with an array of number or reject: if promise has been resolved, array number is rendered with a button to invalidate result, otherwise an alert is invocked. Delayed component is returned from _UsePromise_ component.
* Options accepted by [useParallelPromises](https://react-tools.ndria.dev/hooks/api-dom/useParallelPromises).
5
+
*/
6
+
exporttypeUseParallelPromisesOptions={
7
+
/**
8
+
* Controls how long resolved results are retained
9
+
* in the module-level cache:
10
+
* - **`"unmount"`** — The cache entry is deleted when the component unmounts, forcing
11
+
* a fresh fetch on the next mount.
12
+
* - **`number`** — A time-to-live in **seconds**. The cache entry expires after the given
13
+
* number of seconds from the moment the promise resolves. Expired entries are deleted on
14
+
* the next render and the factory is re-invoked.
15
+
* - **`undefined`** *(default)* — The cache entry persists indefinitely across mounts and
16
+
* unmounts for the lifetime of the module.
17
+
*/
18
+
cache?: "unmount"|number;
19
+
/**
20
+
* An optional array of explicit string keys used to
21
+
* identify each factory in the cache, positionally aligned with the `factories` array.
22
+
* - When provided, `identifiers[i]` is used as the cache key for `factories[i]`.
23
+
* - When omitted, the cache key is derived by serialising the factory function via
24
+
* `toString()`, which may be unreliable after minification. Providing stable explicit
25
+
* identifiers is strongly recommended in production builds.
26
+
*/
27
+
identifiers?: string[];
28
+
};
29
+
30
+
/**
31
+
* Parameters accepted by [useParallelPromises](https://react-tools.ndria.dev/hooks/api-dom/useParallelPromises).
32
+
*
33
+
* @template T - A readonly tuple of zero-argument async factory functions. Inferred automatically from the `factories` argument. The return types of each factory determine the corresponding entry in the result tuple.
0 commit comments