Skip to content

Commit

Permalink
Improved generics.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Apr 14, 2023
1 parent 939a0cc commit e6301d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/suspense/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.)

Expand Down
8 changes: 6 additions & 2 deletions packages/suspense/src/hooks/useImperativeCacheValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import {
} from "../types";
import { useCacheStatus } from "./useCacheStatus";

export function useImperativeCacheValue<Params extends any[], Value>(
export function useImperativeCacheValue<
Params extends any[],
Value,
TParams extends Params
>(
cache: Cache<Params, Value>,
...params: Params
...params: TParams
):
| ImperativeErrorResponse
| ImperativePendingResponse
Expand Down

0 comments on commit e6301d5

Please sign in to comment.