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

[RTK v2.0] output selector fields are currently missing in selector functions created using createDraftSafeSelector. #3722

Merged

Conversation

aryaemami59
Copy link
Contributor

In v2.0.0-beta.1 selectors that are created with createDraftSafeSelector, are missing the output selector fields like: resultFunc, memoizedResultFunc, lastResult, dependencies, recomputations, resetRecomputations and clearCache. I wasn't sure if this was by design or not, since the ts type for createDraftSafeSelectorCreator is the same as createSelectorCreator. Therefore in TypeScript the generated draft safe selectors seem to have all the output selector fields, but will result in an error being thrown during runtime.

Anyway I have a simple fix that should take care of the problem during runtime, however if you do not want the output selector fields to be attached to draft safe selectors I can also fix the ts type.

@codesandbox
Copy link

codesandbox bot commented Sep 14, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

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 7306e84:

Sandbox Source
Vanilla Configuration
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

@netlify
Copy link

netlify bot commented Sep 14, 2023

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

Name Link
🔨 Latest commit 7306e84
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6502762b1ef95f00081262b5
😎 Deploy Preview https://deploy-preview-3722--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.

@markerikson markerikson added this to the 2.0 milestone Oct 19, 2023
@markerikson markerikson merged commit 1016dd9 into reduxjs:v2.0-integration Oct 29, 2023
6 checks passed
@aryaemami59 aryaemami59 deleted the createDraftSafeSelector branch January 16, 2024 11:07
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