hyperweb-io / hyperweb-io/telescope

need extra key to react query customized hooks

Open
#432 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
154
Forks
53
PR merge metrics
No merged PRs in 30d

Description

@marslavish proposed a feature, we should add an extra key to customized hooks to let users define query key by themself to some extent:

```
const useBalance = ({
request,
options,
// input an extra key here
extraKey
}: UseBalanceQuery) => {
return useQuery(["balanceQuery", extraKey ?? request], () => {
if (!queryService) throw new Error("Query Service not initialized");
return queryService.balance(request);
}, options);
};
```

User input extraKey instead of simply using request as a part of the key.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.