diff --git a/packages/suspense/CHANGELOG.md b/packages/suspense/CHANGELOG.md index 7f825e7..151f623 100644 --- a/packages/suspense/CHANGELOG.md +++ b/packages/suspense/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.0.32 +* Improved `useImperativeCacheValue` generics. + ## 0.0.31 * Add optional `immutable` config param to `createCache` to enable optimizing rendering performance for immutable caches. (See [this Loom video](https://www.loom.com/share/dde355b8a9e643adb146768cbd943d39) for background information.) diff --git a/packages/suspense/src/hooks/useImperativeCacheValue.ts b/packages/suspense/src/hooks/useImperativeCacheValue.ts index 8efb90e..5af7e6b 100644 --- a/packages/suspense/src/hooks/useImperativeCacheValue.ts +++ b/packages/suspense/src/hooks/useImperativeCacheValue.ts @@ -13,9 +13,13 @@ import { } from "../types"; import { useCacheStatus } from "./useCacheStatus"; -export function useImperativeCacheValue( +export function useImperativeCacheValue< + Params extends any[], + Value, + TParams extends Params +>( cache: Cache, - ...params: Params + ...params: TParams ): | ImperativeErrorResponse | ImperativePendingResponse