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(deps): update dependency reselect to v5.1.0 #440

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

descope[bot]
Copy link
Contributor

@descope descope bot commented Mar 19, 2024

This PR contains the following updates:

Package Type Update Change
reselect dependencies minor 5.0.1 -> 5.1.0

Release Notes

reduxjs/reselect (reselect)

v5.1.0

Compare Source

This minor release:

  • Adds a new createSelector.withTypes<RootState>() and createStructuredSelector.withTypes<RootState>() API
  • Deprecates the TypedStructuredSelectorCreator type introduced in 5.0
  • Aims to reduce false positives in identityFunctionCheck by only running if the output selector is passed one argument
  • Fixes a bug with weakMapMemoize's resultEqualityCheck when used with a primitive result.
withTypes

Most commonly, selectors will accept the root state of a Redux store as their first argument. withTypes allows you to specify what that first argument will be ahead of creating the selector, meaning it doesn't have to be specified.

// previously
export const selectPostById = createSelector(
  [
    (state: RootState) => state.posts.entities,
    (state: RootState, id: number) => id,
  ],
  (entities, id) => entities[id],
);
// now
export const createAppSelector = createSelector.withTypes<RootState>();

export const selectPostById = createAppSelector(
  [(state) => state.posts.entities, (state, id: number) => id],
  (entities, id) => entities[id],
);
Known limitations

Due to a Typescript issue, inference of the output selector's parameters only works with withTypes when using an array of input selectors.

If using the variadic version, you can either wrap your input selectors in an array instance (as above), or annotate the parameters manually.

export const createAppSelector = createSelector.withTypes<RootState>();

export const selectPostById = createAppSelector(
  (state) => state.posts.entities, 
  (state, id: number) => id,
  // parameters cannot be inferred, so need annotating
  (entities: Record<number, Post>, id: number) => entities[id],
);
What's Changed
New Contributors

Full Changelog: reduxjs/reselect@v5.0.1...v5.1.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@descope descope bot added the renovate label Mar 19, 2024
@descope descope bot enabled auto-merge (squash) March 19, 2024 07:31
@descope descope bot merged commit bba913f into main Mar 19, 2024
5 checks passed
@descope descope bot deleted the renovate/reselect-5.x branch March 19, 2024 07:31
Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
access-key-management-widget ✅ Ready (Inspect) Visit Preview Mar 19, 2024 7:31am
role-management-widget ✅ Ready (Inspect) Visit Preview Mar 19, 2024 7:31am
user-management-widget ✅ Ready (Inspect) Visit Preview Mar 19, 2024 7:31am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants