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

Fix #3970 - Expose types allowing library consumers to build generic utils on top of @reduxjs/toolkit. #4146

Closed
wants to merge 1 commit into from

Conversation

lcharlois-neotys
Copy link

@lcharlois-neotys lcharlois-neotys commented Feb 2, 2024

As discussed on th issue, exposing more types is a good thing as it allows library consumers to build generic piece of code on top of the library.

As I was not sure about which strategy you want to adopt, I choose to expose only the types discussed on the issue.

…eneric utils on top of @reduxjs/toolkit.
Copy link

codesandbox bot commented Feb 2, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

netlify bot commented Feb 2, 2024

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 618a363
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/65bcb9f684336a0008936e22
😎 Deploy Preview https://deploy-preview-4146--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codesandbox-ci bot commented Feb 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 618a363:

Sandbox Source
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@EskiMojo14
Copy link
Collaborator

My concern is that these types, because they're internal, are not particularly user friendly - they're designed to take the internal endpoint definition that you can't get a hold of easily.

I'd rather a wrapper like we have for TypedUseQueryResult/TypedUseMutationResult etc, which takes friendlier arguments and passes them to the internal types to get the final type.

@lcharlois-neotys
Copy link
Author

My concern is that these types, because they're internal, are not particularly user friendly - they're designed to take the internal endpoint definition that you can't get a hold of easily.

I'd rather a wrapper like we have for TypedUseQueryResult/TypedUseMutationResult etc, which takes friendlier arguments and passes them to the internal types to get the final type.

It looks nice and effectively provide a more user-friendly type.
I will give a try to your porposition to see if it works in my use case.

@lcharlois-neotys
Copy link
Author

I close this PR since the solution suggested by @EskiMojo14 in #4147 looks to better than this one.

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.

None yet

3 participants