Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing Instant hooks #434

Merged
merged 4 commits into from
Aug 11, 2023
Merged

Exposing Instant hooks #434

merged 4 commits into from
Aug 11, 2023

Conversation

Zetazzz
Copy link
Collaborator

@Zetazzz Zetazzz commented Aug 10, 2023

add react query options:

reactQuery.instantExport.include.patterns:
if set, will expose instant hooks on matched patterns of packages + method(e.g. cosmos.bank.v1beta1.useBalance) using minimatch. If there're duplicated method names in multiple packages without setting reactQuery.instantExport.nameMapping, one duplicated name will created like: useCosmosBankV1beta1Balance

reactQuery.instantExport.nameMapping
map an alias to a package + method in case of better naming of duplicated method names. (e.g. useBankBalance: cosmos.bank.v1beta1.useBalance) Customized hook name is set in front of pkg+method, by doing this we can prevent duplicate alias.

To expose instant hooks like:

    useCertificates: _AkashCertV1beta2Queryrpc.createRpcQueryHooks(rpc).useCertificates,
    useBalance: _CosmosBankV1beta1Queryrpc.createRpcQueryHooks(rpc).useBalance,
    useCosmosNftV1beta1Balance: _CosmosNftV1beta1Queryrpc.createRpcQueryHooks(rpc).useBalance,
    usePools: _OsmosisGammV1beta1Queryrpc.createRpcQueryHooks(rpc).usePools,
    useNumPools: _OsmosisGammV1beta1Queryrpc.createRpcQueryHooks(rpc).useNumPools,

@pyramation pyramation merged commit a4d7e88 into main Aug 11, 2023
2 checks passed
@Zetazzz Zetazzz removed the request for review from pyramation August 11, 2023 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants